From patchwork Tue Jul 2 19:31:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 256494 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "aserp1040.oracle.com", Issuer "VeriSign Class 3 International Server CA - G3" (not verified)) by ozlabs.org (Postfix) with ESMTPS id CDC772C0077 for ; Wed, 3 Jul 2013 05:32:10 +1000 (EST) Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r62JW74E014368 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 2 Jul 2013 19:32:08 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r62JW7l0027979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 2 Jul 2013 19:32:07 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1Uu6J5-0000Tw-7X; Tue, 02 Jul 2013 12:32:07 -0700 Received: from acsinet22.oracle.com ([141.146.126.238]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1Uu6Ij-0000Sr-UA for fedfs-utils-devel@oss.oracle.com; Tue, 02 Jul 2013 12:31:46 -0700 Received: from userp1020.oracle.com (userp1020.oracle.com [156.151.31.79]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r62JVjIG005720 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 2 Jul 2013 19:31:45 GMT Received: from manray.1015granger.net (adsl-99-26-161-222.dsl.sfldmi.sbcglobal.net [99.26.161.222]) by userp1020.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r62JV8xk032664 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 2 Jul 2013 19:31:09 GMT Received: from manray.1015granger.net (localhost [127.0.0.1]) by manray.1015granger.net (8.14.7/8.14.7) with ESMTP id r62JVhuw048457 for ; Tue, 2 Jul 2013 15:31:43 -0400 To: fedfs-utils-devel@oss.oracle.com From: Chuck Lever Date: Tue, 02 Jul 2013 15:31:43 -0400 Message-ID: <20130702193143.48202.38726.stgit@manray.1015granger.net> In-Reply-To: <20130702191631.48202.83851.stgit@manray.1015granger.net> References: <20130702191631.48202.83851.stgit@manray.1015granger.net> User-Agent: StGit/0.16 MIME-Version: 1.0 X-Flow-Control-Info: class=Pass-to-MM reputation=ipRisk-All ip=99.26.161.222 ct-class=T2 ct-vol1=1 ct-vol2=0 ct-vol3=0 ct-risk=58 ct-spam1=0 ct-spam2=0 ct-bulk=0 rcpts=1 size=3452 X-Sendmail-CM-Score: 0.00% X-Sendmail-CM-Analysis: v=2.1 cv=D7V+dJhj c=1 sm=1 tr=0 a=VArTBjHSyJYTe+J30wkXtQ==:117 a=VArTBjHSyJYTe+J30wkXtQ==:17 a=dzsqy3y4QnMA:10 a=f2Bl1_OrXesA:10 a=dPGociXpb70A:10 a=IkcTkHD0fZMA:10 a=yPCof4ZbAAAA:8 a=Lb1rMZzfAAAA:8 a=8AO87M_pjRMA:10 a=7mOBRU54AAAA:8 a=F sYqM2wqAAAA:8 a=aqJINf6gh--XNu7WRI0A:9 a=QEXdDO2ut3YA:10 a=0kPLrQdw3YYA:10 a=7DSvI1NPTFQA:10 X-Sendmail-CT-Classification: not spam X-Sendmail-CT-RefID: str=0001.0A090204.51D32AA1.000B, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 Subject: [fedfs-utils] [PATCH 11/11] Makefile: Specify as-needed when building executables X-BeenThere: fedfs-utils-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list Reply-To: fedfs-utils Developers List-Id: fedfs-utils Developers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: fedfs-utils-devel-bounces@oss.oracle.com Errors-To: fedfs-utils-devel-bounces@oss.oracle.com X-Source-IP: acsinet21.oracle.com [141.146.126.237] The "--as-needed" linker flag reduces the number of unused objects and dependencies in an executable, making it smaller and faster to load. Some distributions implicitly specify "--as-needed" when linking their package builds. Building on Fedora appears not to. So that building on any platform can catch build problems before they are committed, explicitly specify --as-needed for executables. References: http://www.gentoo.org/proj/en/qa/asneeded.xml#doc_chap1 https://sigquit.wordpress.com/tag/gnu-libtool/ Reviewed-by: David Disseldorp Signed-off-by: Chuck Lever --- src/fedfsc/Makefile.am | 1 + src/fedfsd/Makefile.am | 1 + src/mount/Makefile.am | 1 + src/nfsref/Makefile.am | 1 + src/nsdbc/Makefile.am | 1 + src/nsdbparams/Makefile.am | 1 + 6 files changed, 6 insertions(+) diff --git a/src/fedfsc/Makefile.am b/src/fedfsc/Makefile.am index 808c886..df204d3 100644 --- a/src/fedfsc/Makefile.am +++ b/src/fedfsc/Makefile.am @@ -45,3 +45,4 @@ AM_CFLAGS = -ggdb -fstrict-aliasing \ -Wall -Wextra -pedantic -Wformat=2 \ -Wstrict-aliasing=2 -Wp,-D_FORTIFY_SOURCE=2 AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include -I/usr/include/tirpc +AM_LDFLAGS = -Wl,--as-needed diff --git a/src/fedfsd/Makefile.am b/src/fedfsd/Makefile.am index 583a49a..8ff35b9 100644 --- a/src/fedfsd/Makefile.am +++ b/src/fedfsd/Makefile.am @@ -42,6 +42,7 @@ AM_CFLAGS = -ggdb -fstrict-aliasing \ -Wall -Wextra -pedantic -Wformat=2 \ -Wstrict-aliasing=2 -Wp,-D_FORTIFY_SOURCE=2 AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include -I/usr/include/tirpc +AM_LDFLAGS = -Wl,--as-needed ####################################################################### # The following allows the current practice of having diff --git a/src/mount/Makefile.am b/src/mount/Makefile.am index b48d842..6aaaaa4 100644 --- a/src/mount/Makefile.am +++ b/src/mount/Makefile.am @@ -41,3 +41,4 @@ AM_CFLAGS = -ggdb -fstrict-aliasing \ -Wall -Wextra -pedantic -Wformat=2 \ -Wstrict-aliasing=2 -Wp,-D_FORTIFY_SOURCE=2 AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include +AM_LDFLAGS = -Wl,--as-needed diff --git a/src/nfsref/Makefile.am b/src/nfsref/Makefile.am index 71e9242..6574db7 100644 --- a/src/nfsref/Makefile.am +++ b/src/nfsref/Makefile.am @@ -40,3 +40,4 @@ AM_CFLAGS = -ggdb -fstrict-aliasing \ -Wall -Wextra -pedantic -Wformat=2 \ -Wstrict-aliasing=2 -Wp,-D_FORTIFY_SOURCE=2 AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include +AM_LDFLAGS = -Wl,--as-needed diff --git a/src/nsdbc/Makefile.am b/src/nsdbc/Makefile.am index 0b32082..5c4f865 100644 --- a/src/nsdbc/Makefile.am +++ b/src/nsdbc/Makefile.am @@ -42,3 +42,4 @@ AM_CFLAGS = -ggdb -fstrict-aliasing \ -Wall -Wextra -pedantic -Wformat=2 \ -Wstrict-aliasing=2 -Wp,-D_FORTIFY_SOURCE=2 AM_CPPFLAGS = -I$(top_srcdir)/src/include -I/usr/include/tirpc +AM_LDFLAGS = -Wl,--as-needed diff --git a/src/nsdbparams/Makefile.am b/src/nsdbparams/Makefile.am index 0da4d0c..e18011a 100644 --- a/src/nsdbparams/Makefile.am +++ b/src/nsdbparams/Makefile.am @@ -40,3 +40,4 @@ AM_CFLAGS = -ggdb -fstrict-aliasing \ -Wall -Wextra -pedantic -Wformat=2 \ -Wstrict-aliasing=2 -Wp,-D_FORTIFY_SOURCE=2 AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include -I/usr/include/tirpc +AM_LDFLAGS = -Wl,--as-needed