[PATCH] Fix PR target/30572 libgcc_s install name

Etsushi Kato ek.kato@gmail.com
Wed Dec 19 08:51:00 GMT 2007


On Dec 19, 2007 4:49 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Dec 19, 2007 at 02:50:25PM +0900, Etsushi Kato wrote:
> > Index: libgcc/Makefile.in
> > ===================================================================
> > --- libgcc/Makefile.in        (revision 131032)
> > +++ libgcc/Makefile.in        (working copy)
> > @@ -739,7 +739,8 @@
> >               @shlib_objs@,$(objects),$(subst \
> >               @shlib_base_name@,libgcc_s,$(subst \
> >               @shlib_map_file@,$(mapfile),$(subst \
> > -             @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_LINK)))))))
> > +             @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
> > +             @shlib_slibdir@,@slibdir@,$(SHLIB_LINK))))))))
>
> This will misbehave if @slibdir@ is expanded with a comma inside of it (I know
> it is not very probable, but anyway).
> Wouldn't it be safer to
> shlib_slibdir=@slibdir@
> close to the beginning of libgcc/Makefile.in and then
>                 @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
>                 @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))
> ?

Thanks for your comment.  I didn't think of comma inside @slibdir@ ;)
 Anyway, here is one more try.  Tested this on Mac OS X 10.4.11 and
Fedora 8 again.


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

	PR target/30572
	* Makefile.in: Use @shlib_slibdir@ substitution to get
	correct install name on darwin.
	* config/t-slibgcc-darwin: Use @shlib_slibdir@ for -install_name.


Index: libgcc/Makefile.in
===================================================================
--- libgcc/Makefile.in	(revision 131032)
+++ libgcc/Makefile.in	(working copy)
@@ -32,6 +32,7 @@

 exec_prefix = @exec_prefix@
 libdir = @libdir@
+shlib_slibdir = @slibdir@

 SHELL = @SHELL@

@@ -739,7 +740,8 @@
 		@shlib_objs@,$(objects),$(subst \
 		@shlib_base_name@,libgcc_s,$(subst \
 		@shlib_map_file@,$(mapfile),$(subst \
-		@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_LINK)))))))
+		@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
+		@shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))

 libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
 	# @multilib_flags@ is still needed because this may use
Index: libgcc/config/t-slibgcc-darwin
===================================================================
--- libgcc/config/t-slibgcc-darwin	(revision 131032)
+++ libgcc/config/t-slibgcc-darwin	(working copy)
@@ -16,7 +16,7 @@
 # Note that this version is used for the loader, not the linker; the linker
 # uses the stub versions named by the versioned members of $(INSTALL_FILES).
 SHLIB_LINK = $(CC) $(LIBGCC2_CFLAGS) -dynamiclib -nodefaultlibs \
-	-install_name $(slibdir)/$(SHLIB_INSTALL_NAME) \
+	-install_name @shlib_slibdir@/$(SHLIB_INSTALL_NAME) \
 	-single_module -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp \
 	-Wl,-exported_symbols_list,$(SHLIB_MAP) \
 	$(SHLIB_VERSTRING) \


Cheers,
-- 
Etsushi Kato
ek.kato@gmail.com



More information about the Gcc-patches mailing list