From patchwork Tue Jun 30 14:14:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 72457 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 131ADA0350; Tue, 30 Jun 2020 16:15:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A75BC1BFAD; Tue, 30 Jun 2020 16:14:57 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 512E51BFA2 for ; Tue, 30 Jun 2020 16:14:56 +0200 (CEST) IronPort-SDR: qPZLxgRowsD5JUunfxO9FBSF45lEe4mOV7wP9ioK2RlaFx01T2744DbCpC7Y1+dVndQwZlCNZe ASIaCfgPGruA== X-IronPort-AV: E=McAfee;i="6000,8403,9666"; a="207754231" X-IronPort-AV: E=Sophos;i="5.75,297,1589266800"; d="scan'208";a="207754231" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2020 07:14:55 -0700 IronPort-SDR: yA3iDZM9Qmw7OXA3uTIYNhdp4n/N1nGud91LV1I4xwnLFPt9Dg3Fgjwx9nTi9xHS4Yr11iX7eM zZDXsKW3WZeQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,297,1589266800"; d="scan'208";a="303471423" Received: from silpixa00399126.ir.intel.com ([10.237.222.84]) by fmsmga004.fm.intel.com with ESMTP; 30 Jun 2020 07:14:52 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: thomas@monjalon.net, david.marchand@redhat.com, ktraynor@redhat.com, bluca@debian.org, sunil.pai.g@intel.com, Bruce Richardson , Andrzej Ostruszka Date: Tue, 30 Jun 2020 15:14:27 +0100 Message-Id: <20200630141433.818517-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200630141433.818517-1-bruce.richardson@intel.com> References: <20200429100831.398-1-bruce.richardson@intel.com> <20200630141433.818517-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 1/7] build: always link-whole DPDK static libraries 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" To ensure all constructors are included in static build, we need to pass the --whole-archive flag when linking, which is used with the "link_whole" meson option. Since we use link_whole for all libs, we no longer need to track the lib as part of the static dependency, just the path to the headers for compiling. After this patch is applied, all DPDK .a files are inside --whole-archive/--no-whole-archive flags, but external dependencies and shared libs being linked against remain outside. Signed-off-by: Bruce Richardson Tested-by: Andrzej Ostruszka Acked-by: Luca Boccassi Acked-by: Sunil Pai G Acked-by: Thomas Monjalon --- app/test/meson.build | 2 +- drivers/meson.build | 2 +- examples/meson.build | 6 +++--- lib/meson.build | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/test/meson.build b/app/test/meson.build index 5233ead46..b2a1c1273 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -415,7 +415,7 @@ test_dep_objs += cc.find_library('execinfo', required: false) link_libs = [] link_nodes = [] if get_option('default_library') == 'static' - link_libs = dpdk_drivers + link_libs = dpdk_static_libraries + dpdk_drivers link_nodes = dpdk_graph_nodes endif diff --git a/drivers/meson.build b/drivers/meson.build index 01c860c06..e78c76c55 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -200,7 +200,7 @@ foreach class:dpdk_driver_classes shared_dep = declare_dependency(link_with: shared_lib, include_directories: includes, dependencies: shared_deps) - static_dep = declare_dependency(link_with: static_lib, + static_dep = declare_dependency( include_directories: includes, dependencies: static_deps) diff --git a/examples/meson.build b/examples/meson.build index 3b540012f..120eebf71 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -1,10 +1,10 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017-2019 Intel Corporation -driver_libs = [] +link_whole_libs = [] node_libs = [] if get_option('default_library') == 'static' - driver_libs = dpdk_drivers + link_whole_libs = dpdk_static_libraries + dpdk_drivers node_libs = dpdk_graph_nodes endif @@ -101,7 +101,7 @@ foreach example: examples endif executable('dpdk-' + name, sources, include_directories: includes, - link_whole: driver_libs + node_libs, + link_whole: link_whole_libs + node_libs, link_args: dpdk_extra_ldflags, c_args: cflags, dependencies: dep_objs) diff --git a/lib/meson.build b/lib/meson.build index 4cbbca041..c1b9e1633 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -134,7 +134,7 @@ foreach l:libraries dependencies: static_deps, include_directories: includes, install: true) - static_dep = declare_dependency(link_with: static_lib, + static_dep = declare_dependency( include_directories: includes, dependencies: static_deps)