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 D4CCFA00BE; Wed, 29 Apr 2020 12:13:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4A49A1D919; Wed, 29 Apr 2020 12:13:44 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 4EE051D917 for ; Wed, 29 Apr 2020 12:13:43 +0200 (CEST) IronPort-SDR: hPTjPgDVz2EDEfIQSEfWZbXUof74Zi8+E0D2UQRDEvOI7ekGDfcJfOW+XP4IrVrZa+eMp1lIZi KbohhDl4M5cg== 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:42 -0700 IronPort-SDR: r/OnJgRqTGUw2zUCiKQrt1s4GuyLKLmtk6pTyn7bRLH68ubOx2j00A28WPZwwDrOT1WE0VOA9Q rZ3Zv2+7plzA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,331,1583222400"; d="scan'208";a="336915976" Received: from silpixa00399126.ir.intel.com ([10.237.222.218]) by orsmga001.jf.intel.com with ESMTP; 29 Apr 2020 03:13:41 -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:25 +0100 Message-Id: <20200429100831.398-2-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 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. Signed-off-by: Bruce Richardson --- 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 fc60acbe7..5f2c803d6 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -400,7 +400,7 @@ test_dep_objs += cc.find_library('execinfo', required: false) link_libs = [] if get_option('default_library') == 'static' - link_libs = dpdk_drivers + link_libs = dpdk_static_libraries + dpdk_drivers endif dpdk_test = executable('dpdk-test', diff --git a/drivers/meson.build b/drivers/meson.build index dc293b270..53c2ff0f3 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -196,7 +196,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 1f2b6f516..ec6bd5a08 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -1,9 +1,9 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017-2019 Intel Corporation -driver_libs = [] +link_whole_libs = [] if get_option('default_library') == 'static' - driver_libs = dpdk_drivers + link_whole_libs = dpdk_static_libraries + dpdk_drivers endif execinfo = cc.find_library('execinfo', required: false) @@ -99,7 +99,7 @@ foreach example: examples endif executable('dpdk-' + name, sources, include_directories: includes, - link_whole: driver_libs, + link_whole: link_whole_libs, link_args: dpdk_extra_ldflags, c_args: cflags, dependencies: dep_objs) diff --git a/lib/meson.build b/lib/meson.build index 07a65a625..44b850033 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -128,7 +128,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) -- 2.20.1