From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7F431A00BE; Wed, 29 Apr 2020 12:14:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E5AAE1D67C; Wed, 29 Apr 2020 12:14:03 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 985841D9B0 for ; Wed, 29 Apr 2020 12:13:58 +0200 (CEST) IronPort-SDR: xRSE0Lydj+o7En91XLzYjbNRxXPX/86cN9O+/0fwJZ/x0MjxeBWHU1jsJkY5Ua4Pt3p10Me78M KWrRu9LYeMYg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 03:13:58 -0700 IronPort-SDR: ObM78wiuYpqAJo1vYPi8LpevJuHZmQRv0k99stMrjgURkTngq9UQBKFCZ5k5YFeB8aKoQNQzII UdHoJzdDEclg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,331,1583222400"; d="scan'208";a="336916040" Received: from silpixa00399126.ir.intel.com ([10.237.222.218]) by orsmga001.jf.intel.com with ESMTP; 29 Apr 2020 03:13:56 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: thomas@monjalon.net, bluca@debian.org, david.marchand@redhat.com, ktraynor@redhat.com, Bruce Richardson Date: Wed, 29 Apr 2020 11:08:31 +0100 Message-Id: <20200429100831.398-8-bruce.richardson@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200429100831.398-1-bruce.richardson@intel.com> References: <20200429100831.398-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 7/7] build/pkg-config: prevent overlinking X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add the --as-needed linker flag to the DPDK library list in the pkg-config file so as to prevent overlinking. Without this flag, when linking statically using flags from $(pkg-config --static --libs libdpdk), all DPDK drivers and libs were statically linked in, but the binary was also requiring all the shared versions be present to run. Signed-off-by: Bruce Richardson --- buildtools/pkg-config/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build index bc723317c..07b556288 100644 --- a/buildtools/pkg-config/meson.build +++ b/buildtools/pkg-config/meson.build @@ -22,7 +22,7 @@ pkg.generate(name: 'dpdk-libs', version: meson.project_version(), subdirs: [get_option('include_subdir_arch'), '.'], extra_cflags: pkg_extra_cflags, - libraries: dpdk_libraries, + libraries: ['-Wl,--as-needed'] + dpdk_libraries, libraries_private: dpdk_extra_ldflags) pkg.generate(name: 'DPDK', # main DPDK pkgconfig file -- 2.20.1