This is the mail archive of the bfd@sourceware.cygnus.com mailing list for the bfd project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: installing c++filt


On Fri, 13 February 1998, 12:55:58, jbuck@synopsys.com wrote:

 > 
 > > It makes much more sense for the compiler to install c++filt, since it
 > > knows about the latest changes to the mangling code.  Any reason not to
 > > stop installing c++filt from bfd?
 > 
 > c++filt should be installed with the compiler, not with bfd.  (Though if
 > there is a skew between binutils and g++'s idea of what the name mangling
 > scheme is, reports from GNU ld will be wrong).
 > 

I started a  discussion about this on egcs-bugs  in early October last
year  (look  for `egcs-970929:  Install   c++filt' in  the archive for
details about it); we didn't come to a final agreement ;-(

Anyway,  here is an updated version  of the patch I submitted relative
to the CVS tree as of 1998/02/13 16:33:18:

Sat Feb 14 11:50:51 1998  Manfred Hollstein  <manfred@s-direktnet.de>

	* Make-lang.in (DEMANGLER_INSTALL_NAME, DEMANGLER_CROSS_NAME): New macros.
	(c++.install-common): Install c++filt properly as native or as cross
	variant.
	(c++.uninstall): Add c++filt.

diff -u -p egcs/gcc/cp/Make-lang.in.orig egcs/gcc/cp/Make-lang.in
--- egcs/gcc/cp/Make-lang.in.orig	Fri Feb 13 01:30:27 1998
+++ egcs/gcc/cp/Make-lang.in	Sat Feb 14 11:56:11 1998
@@ -45,10 +45,12 @@ CXX_FLAGS_TO_PASS = \
 # Actual names to use when installing a native compiler.
 CXX_INSTALL_NAME = `t='$(program_transform_name)'; echo c++ | sed $$t`
 GXX_INSTALL_NAME = `t='$(program_transform_name)'; echo g++ | sed $$t`
+DEMANGLER_INSTALL_NAME = `t='$(program_transform_name)'; echo c++filt | sed $$t`
 
 # Actual names to use when installing a cross-compiler.
 CXX_CROSS_NAME = `t='$(program_transform_cross_name)'; echo c++ | sed $$t`
 GXX_CROSS_NAME = `t='$(program_transform_cross_name)'; echo g++ | sed $$t`
+DEMANGLER_CROSS_NAME = `t='$(program_transform_cross_name)'; echo c++filt | sed $$t`
 
 # The name to use for the demangler program.
 DEMANGLER_PROG = c++filt$(exeext)
@@ -225,8 +227,17 @@ c++.install-common:
 	    rm -f $(bindir)/$(CXX_INSTALL_NAME)$(exeext); \
 	    $(LN) $(bindir)/$(GXX_INSTALL_NAME)$(exeext) $(bindir)/$(CXX_INSTALL_NAME)$(exeext); \
 	  fi ; \
-	  rm -f $(bindir)/$(DEMANGLER_PROG) ; \
-	  $(INSTALL_PROGRAM) $(DEMANGLER_PROG) $(bindir)/$(DEMANGLER_PROG) ; \
+	  if [ x$(DEMANGLER_PROG) != x ] && [ -x "$(DEMANGLER_PROG)" ]; then \
+	    if [ -f g++-cross$(exeext) ] ; then \
+	      rm -f $(bindir)/$(DEMANGLER_CROSS_NAME)$(exeext); \
+	      $(INSTALL_PROGRAM) $(DEMANGLER_PROG) $(bindir)/$(DEMANGLER_CROSS_NAME)$(exeext); \
+	      chmod a+x $(bindir)/$(DEMANGLER_CROSS_NAME)$(exeext); \
+	    else \
+	      rm -f $(bindir)/$(DEMANGLER_INSTALL_NAME)$(exeext); \
+	      $(INSTALL_PROGRAM) $(DEMANGLER_PROG) $(bindir)/$(DEMANGLER_INSTALL_NAME)$(exeext); \
+	      chmod a+x $(bindir)/$(DEMANGLER_INSTALL_NAME)$(exeext); \
+	    fi ; \
+	  fi ; \
 	fi
 
 c++.install-info:
@@ -249,6 +260,8 @@ c++.uninstall:
 	-rm -rf $(bindir)/$(CXX_CROSS_NAME)$(exeext)
 	-rm -rf $(bindir)/$(GXX_INSTALL_NAME)$(exeext)
 	-rm -rf $(bindir)/$(GXX_CROSS_NAME)$(exeext)
+	-rm -rf $(bindir)/$(DEMANGLER_INSTALL_NAME)$(exeext)
+	-rm -rf $(bindir)/$(DEMANGLER_CROSS_NAME)$(exeext)
 	-rm -rf $(mandir)/$(GXX_INSTALL_NAME)$(manext)
 	-rm -rf $(mandir)/$(GXX_CROSS_NAME)$(manext)
 #