Patchwork [libgcc,build] cater for static archives as 'extra parts'

login
register
mail settings
Submitter IainS
Date Sept. 15, 2010, 3:51 p.m.
Message ID <C630F665-A3CC-4F2A-A662-251B4FF2F39F@sandoe-acoustics.co.uk>
Download mbox | patch
Permalink /patch/64837/
State New
Headers show

Comments

IainS - Sept. 15, 2010, 3:51 p.m.
Hi,

It would tidy up cases where several "extra parts" objects are used if  
they could be made into a static archive.

At present, although "extra parts" can be built as static archives,  
libgcc's build process does not carry out the additional ranlib needed  
by some targets after installing them.

This patch looks for static archives in the list and applies the ranlib.

(I have a tidy-up patch for darwin which would like to use this  
facility),

OK for trunk?
Iain

libgcc:

	* Makefile.in (libgcc-extra-parts):  Check for static archives and  
ranlib after installing.
	(gcc-extra-parts): Likewise.
	(install-leaf): LIkewise.
Paolo Bonzini - Sept. 15, 2010, 3:52 p.m.
On 09/15/2010 05:51 PM, IainS wrote:
> Index: libgcc/Makefile.in
> ===================================================================
> --- libgcc/Makefile.in (revision 164304)
> +++ libgcc/Makefile.in (working copy)
> @@ -870,6 +870,9 @@ endif
> for file in $$parts; do \
> rm -f $(gcc_objdir)$(MULTISUBDIR)/$$file; \
> $(INSTALL_DATA) $$file $(gcc_objdir)$(MULTISUBDIR)/; \
> + if [ $${file##*.} = "a" ] ; then \
> + $(RANLIB) $(gcc_objdir)$(MULTISUBDIR)/$$file; \
> + fi; \

Please use "case", ${file##*.} is a bashism.

Paolo

Patch

Index: libgcc/Makefile.in
===================================================================
--- libgcc/Makefile.in	(revision 164304)
+++ libgcc/Makefile.in	(working copy)
@@ -870,6 +870,9 @@  endif
  	for file in $$parts; do					\
  	  rm -f $(gcc_objdir)$(MULTISUBDIR)/$$file;		\
  	  $(INSTALL_DATA) $$file $(gcc_objdir)$(MULTISUBDIR)/;	\
+	  if [ $${file##*.} = "a" ] ; then 			\
+	    $(RANLIB) $(gcc_objdir)$(MULTISUBDIR)/$$file;	\
+	  fi;							\
  	done

  # Build extra startfiles in the gcc directory, for unconverted
@@ -903,6 +906,9 @@  gcc-extra-parts:
  	for file in $$parts; do					\
  	  rm -f $(gcc_objdir)$(MULTISUBDIR)/$$file;		\
  	  $(INSTALL_DATA) $$file $(gcc_objdir)$(MULTISUBDIR)/;	\
+	  if [ $${file##*.} = "a" ] ; then 			\
+	    $(RANLIB) $(gcc_objdir)$(MULTISUBDIR)/$$file;	\
+	  fi;							\
  	done

  all: $(extra-parts)
@@ -958,6 +964,9 @@  install-leaf: $(install-shared) $(install-libunwin
  	for file in $$parts; do					\
  	  rm -f $(DESTDIR)$(inst_libdir)/$$file;		\
  	  $(INSTALL_DATA) $$file $(DESTDIR)$(inst_libdir)/;	\
+	  if [ $${file##*.} = "a" ] ; then 			\
+	    $(RANLIB) $(gcc_objdir)$(MULTISUBDIR)/$$file;	\
+	  fi;							\
  	done

  install: install-leaf