From patchwork Fri Oct 16 16:28:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lynn A. Boger" X-Patchwork-Id: 531477 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id DFB741401F6 for ; Sat, 17 Oct 2015 03:29:06 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=tTSqHBWJ; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=aehFYrRkigQOLLjmBa42cYZlL1qbsap97zKq2n2hsX/MtLed2a TwR8a8+xZJJOjF+lDo8MEqJd1x1IXcf++S/NUxNVgPmjI+wueUHsFTaF04ka6Xj/ /4Z+EI1WSf4ZCA1T0PG2Ox4ntEFYOXK37bBfWVnlNVkx3tvFgaD6bveB0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=3j5JDHuR0GtmJ3WjFaqCYD0t+8s=; b=tTSqHBWJW9SfJ0I81j3b vW7QjdVUM5oootb5uQ8oxhUKj0Jd+B0CrR3bXC2zUaTrqbj3SWp83+vtAzkVMZgL GfKcSBjVsxRq91slx5Gm8ME863yF68jkLNTJyPH7DJWv53Kbs+G1SQmxBc3n6lXr EP5SOZQdFNOvY5xs3qJYu7U= Received: (qmail 44675 invoked by alias); 16 Oct 2015 16:28:59 -0000 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 Received: (qmail 44660 invoked by uid 89); 16 Oct 2015 16:28:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.0 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: e38.co.us.ibm.com Received: from e38.co.us.ibm.com (HELO e38.co.us.ibm.com) (32.97.110.159) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 16 Oct 2015 16:28:57 +0000 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 16 Oct 2015 10:28:55 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 16 Oct 2015 10:28:54 -0600 X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: laboger@linux.vnet.ibm.com X-IBM-RcptTo: gcc-patches@gcc.gnu.org Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id DFBF11FF002D for ; Fri, 16 Oct 2015 10:17:05 -0600 (MDT) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t9GGPcjq2097418 for ; Fri, 16 Oct 2015 09:25:38 -0700 Received: from d03av03.boulder.ibm.com (localhost [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t9GGSrXj004278 for ; Fri, 16 Oct 2015 10:28:53 -0600 Received: from oc3540537726.ibm.com (oc3540537726.ibm.com.rchland.ibm.com [9.10.86.61] (may be forged)) by d03av03.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t9GGSrZk004240; Fri, 16 Oct 2015 10:28:53 -0600 To: gcc-patches , Ian Taylor From: "Lynn A. Boger" Subject: [PATCH] Eliminate libgo.so dependency for go and gofmt tools in gotools/ Message-ID: <562125C4.70107@linux.vnet.ibm.com> Date: Fri, 16 Oct 2015 11:28:52 -0500 User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15101616-0029-0000-0000-00000D6660D3 X-IsSubscribed: yes To make it easier to use gotools go and gofmt, add -static-libgo when linking them. This makes it nicer in all cases since it eliminates the dependency on libgo.so for these tools, but it is mostly helpful for the cross compiled case. When building for use in the cross compiled case, this allows for go and gofmt to be built with a gccgo that is available during the build but then libgo.so is not a dependency when using go or gofmt once the build is finished. The cgo tool is also built here but since that is needed during compiling with gccgo I left that as is. 2015-10-16 Lynn Boger gotools/ Makefile.am: Add -static-libgo to the link for go and gofmt tools. Makefile.in: Regenerate. Index: gotools/Makefile.am =================================================================== --- gotools/Makefile.am (revision 228851) +++ gotools/Makefile.am (working copy) @@ -109,10 +109,12 @@ bin_PROGRAMS = go$(EXEEXT) gofmt$(EXEEXT) noinst_PROGRAMS = cgo$(EXEEXT) man_MANS = go.1 gofmt.1 +# Add -static-libgo to the link for go and gofmt to avoid the libgo.so +# dependency. go$(EXEEXT): $(go_cmd_go_files) zdefaultcc.go $(LIBGODEP) - $(GOLINK) $(go_cmd_go_files) zdefaultcc.go $(LIBS) $(NET_LIBS) + $(GOLINK) -static-libgo $(go_cmd_go_files) zdefaultcc.go $(LIBS) $(NET_LIBS) gofmt$(EXEEXT): $(go_cmd_gofmt_files) $(LIBGODEP) - $(GOLINK) $(go_cmd_gofmt_files) $(LIBS) $(NET_LIBS) + $(GOLINK) -static-libgo $(go_cmd_gofmt_files) $(LIBS) $(NET_LIBS) cgo$(EXEEXT): $(go_cmd_cgo_files) zdefaultcc.go $(LIBGODEP) $(GOLINK) $(go_cmd_cgo_files) zdefaultcc.go $(LIBS) $(NET_LIBS) Index: gotools/Makefile.in =================================================================== --- gotools/Makefile.in (revision 228851) +++ gotools/Makefile.in (working copy) @@ -663,10 +663,12 @@ s-zdefaultcc: Makefile $(SHELL) $(srcdir)/../move-if-change zdefaultcc.go.tmp zdefaultcc.go $(STAMP) $@ +# Add -static-libgo to the link for go and gofmt to avoid the libgo.so +# dependency. @NATIVE_TRUE@go$(EXEEXT): $(go_cmd_go_files) zdefaultcc.go $(LIBGODEP) -@NATIVE_TRUE@ $(GOLINK) $(go_cmd_go_files) zdefaultcc.go $(LIBS) $(NET_LIBS) +@NATIVE_TRUE@ $(GOLINK) -static-libgo $(go_cmd_go_files) zdefaultcc.go $(LIBS) $(NET_LIBS) @NATIVE_TRUE@gofmt$(EXEEXT): $(go_cmd_gofmt_files) $(LIBGODEP) -@NATIVE_TRUE@ $(GOLINK) $(go_cmd_gofmt_files) $(LIBS) $(NET_LIBS) +@NATIVE_TRUE@ $(GOLINK) -static-libgo $(go_cmd_gofmt_files) $(LIBS) $(NET_LIBS) @NATIVE_TRUE@cgo$(EXEEXT): $(go_cmd_cgo_files) zdefaultcc.go $(LIBGODEP) @NATIVE_TRUE@ $(GOLINK) $(go_cmd_cgo_files) zdefaultcc.go $(LIBS) $(NET_LIBS)