From patchwork Sat Nov 20 19:38:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralf Wildenhues X-Patchwork-Id: 72361 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 79914B7157 for ; Sun, 21 Nov 2010 06:39:50 +1100 (EST) Received: (qmail 29211 invoked by alias); 20 Nov 2010 19:39:48 -0000 Received: (qmail 29169 invoked by uid 22791); 20 Nov 2010 19:39:45 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mailout-de.gmx.net (HELO mail.gmx.net) (213.165.64.23) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Sat, 20 Nov 2010 19:38:33 +0000 Received: (qmail invoked by alias); 20 Nov 2010 19:38:30 -0000 Received: from xdsl-89-0-138-101.netcologne.de (EHLO localhost.localdomain) [89.0.138.101] by mail.gmx.net (mp009) with SMTP; 20 Nov 2010 20:38:30 +0100 Received: from ralf by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1PJtGX-0005oV-L8; Sat, 20 Nov 2010 20:38:29 +0100 Date: Sat, 20 Nov 2010 20:38:29 +0100 From: Ralf Wildenhues To: Gerald Pfeifer Cc: gcc-patches@gcc.gnu.org, binutils@sourceware.org, gdb-patches@sourceware.org, NightStrike Subject: Re: make install-strip with binutils Message-ID: <20101120193829.GC24876@gmx.de> Mail-Followup-To: Ralf Wildenhues , Gerald Pfeifer , gcc-patches@gcc.gnu.org, binutils@sourceware.org, gdb-patches@sourceware.org, NightStrike References: <20101023095951.GN2183@gmx.de> <20101027182939.GI15343@gmx.de> <20101102200841.GG4123@gmx.de> <20101117190145.GE12746@gmx.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2010-08-04) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org * Gerald Pfeifer wrote on Sat, Nov 20, 2010 at 01:24:13AM CET: > On Wed, 17 Nov 2010, Ralf Wildenhues wrote: > > Now, as GCC build maintainer, it seems most of this patch is free to > > proceed on (still, I'd welcome any review!), and the src bits are > > trivial. The web update has been OKed off-list by Gerald, so the only > > remaining bits are in gcc/doc/install.texi. Is that part of the build > > maintainer role too, or OK to go ahead with? > > I can approve that one, too. :-) > > There is one thing there that may confuse our users a bit and that is > the following: Fixed according to your suggestion. Thanks for the review! I noticed one more problem: target-specific exports are supported since GNU make 3.81 only, but GCC only requires 3.80. Luckily nothing besides install-sh uses STRIPPROG, and install-sh tests for non-empty rather than unset variable for its semantics, so we can export the variable from gcc/Makefile.in. The gcc/ part of the final patch is shown below, the rest as in . I've committed the whole patch to GCC and src now. Cheers, Ralf PR other/46202: implement install-strip. gcc/: PR other/46202 * Makefile.in (install_sh, INSTALL_STRIP_PROGRAM): New variables. (AR_FOR_TARGET, RANLIB_FOR_TARGET, STRIP_FOR_TARGET): Fix shell quoting. (STRIP_FOR_TARGET): Look for in-tree strip under name strip-new. (install-strip): New target. (STRIPPROG): New variable, exported if STRIP is set. * doc/install.texi (Final install): Minor markup and code style fixes. Document install-strip target. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 5491aeaf..98f06e9 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -22,7 +22,7 @@ #. # The targets for external use include: -# all, doc, install, install-cross, install-cross-rest, +# all, doc, install, install-cross, install-cross-rest, install-strip, # uninstall, TAGS, mostlyclean, clean, distclean, maintainer-clean. # This is the default target. @@ -255,6 +255,8 @@ LN_S=@LN_S@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL@ +install_sh = $(SHELL) $(srcdir)/../install-sh +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s MAKEINFO = @MAKEINFO@ MAKEINFOFLAGS = --no-split TEXI2DVI = texi2dvi @@ -387,7 +389,7 @@ AR_FOR_TARGET := $(shell \ if [ "$(host)" = "$(target)" ] ; then \ echo $(AR); \ else \ - t='$(program_transform_name)'; echo ar | sed -e $$t ; \ + t='$(program_transform_name)'; echo ar | sed -e "$$t" ; \ fi; \ fi) AR_FLAGS_FOR_TARGET = @@ -402,20 +404,20 @@ RANLIB_FOR_TARGET := $(shell \ if [ "$(host)" = "$(target)" ] ; then \ echo $(RANLIB); \ else \ - t='$(program_transform_name)'; echo ranlib | sed -e $$t ; \ + t='$(program_transform_name)'; echo ranlib | sed -e "$$t" ; \ fi; \ fi) ORIGINAL_LD_FOR_TARGET = @ORIGINAL_LD_FOR_TARGET@ ORIGINAL_NM_FOR_TARGET = @ORIGINAL_NM_FOR_TARGET@ NM_FOR_TARGET = ./nm STRIP_FOR_TARGET := $(shell \ - if [ -f $(objdir)/../binutils/strip ] ; then \ - echo $(objdir)/../binutils/strip ; \ + if [ -f $(objdir)/../binutils/strip-new ] ; then \ + echo $(objdir)/../binutils/strip-new ; \ else \ if [ "$(host)" = "$(target)" ] ; then \ echo strip; \ else \ - t='$(program_transform_name)'; echo strip | sed -e $$t ; \ + t='$(program_transform_name)'; echo strip | sed -e "$$t" ; \ fi; \ fi) @@ -4488,7 +4490,7 @@ maintainer-clean: -rm -f gcc.??s gcc.*aux -rm -f $(gcc_docdir)/*.info $(gcc_docdir)/*.1 $(gcc_docdir)/*.7 $(gcc_docdir)/*.dvi $(gcc_docdir)/*.pdf # -# Entry points `install' and `uninstall'. +# Entry points `install', `install-strip', and `uninstall'. # Also use `install-collect2' to install collect2 when the config files don't. # Copy the compiler files into directories where they will be run. @@ -4502,6 +4504,13 @@ ifeq ($(enable_plugin),yes) install: install-plugin endif +install-strip: override INSTALL_PROGRAM = $(INSTALL_STRIP_PROGRAM) +ifneq ($(STRIP),) +install-strip: STRIPPROG = $(STRIP) +export STRIPPROG +endif +install-strip: install + # Handle cpp installation. install-cpp: installdirs cpp$(exeext) -rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext) diff --git a/gcc/config/i386/t-cygming b/gcc/config/i386/t-cygming index 183e545..6395ff9 100644 --- a/gcc/config/i386/t-cygming +++ b/gcc/config/i386/t-cygming @@ -92,7 +92,7 @@ SHLIB_LINK = $(LN_S) -f $(SHLIB_MAP) $(SHLIB_MAP).def && \ # libgcc.mk. We want this delayed until actual install time. SHLIB_INSTALL = \ $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \ - $(INSTALL_PROGRAM) $(SHLIB_DIR)/$(SHLIB_SONAME) \ + $(INSTALL) $(SHLIB_DIR)/$(SHLIB_SONAME) \ $$(DESTDIR)$$(bindir)/$(SHLIB_SONAME); \ $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_IMPLIB) \ $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_IMPLIB) diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 1c9d463..e67793a 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -2617,7 +2617,7 @@ messages may be automatically processed. Now that GCC has been built (and optionally tested), you can install it with @smallexample -cd @var{objdir}; make install +cd @var{objdir} && make install @end smallexample We strongly recommend to install into a target directory where there is @@ -2653,7 +2653,8 @@ jail can be achieved with the command make DESTDIR=@var{path-to-rootdir} install @end smallexample -@noindent where @var{path-to-rootdir} is the absolute path of +@noindent +where @var{path-to-rootdir} is the absolute path of a directory relative to which all installation paths will be interpreted. Note that the directory specified by @code{DESTDIR} need not exist yet; it will be created if necessary. @@ -2667,6 +2668,12 @@ it will not be created otherwise. This is regarded as a feature, not as a bug, because it gives slightly more control to the packagers using the @code{DESTDIR} feature. +You can install stripped programs and libraries with + +@smallexample +make install-strip +@end smallexample + If you are bootstrapping a released version of GCC then please quickly review the build status page for your release, available from @uref{http://gcc.gnu.org/buildstat.html}.