From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 0F97AA0350;
	Wed,  1 Jul 2020 16:19:18 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 401461BED7;
	Wed,  1 Jul 2020 16:19:17 +0200 (CEST)
Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com
 [64.147.123.21]) by dpdk.org (Postfix) with ESMTP id 9807C1BDFD
 for <dev@dpdk.org>; Wed,  1 Jul 2020 16:19:15 +0200 (CEST)
Received: from compute7.internal (compute7.nyi.internal [10.202.2.47])
 by mailout.west.internal (Postfix) with ESMTP id DF2649CA;
 Wed,  1 Jul 2020 10:19:12 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute7.internal (MEProxy); Wed, 01 Jul 2020 10:19:13 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding:content-type; s=fm1; bh=
 cWIJBKUnCDc1IbGyBsYVvdE7RB80OYRO3nQExL1FrSA=; b=SUlqZZRwK+i5lmIb
 /tykbn3O72zE3lF7TNAPi3RaVdydiuoi/smchkUsLnQbRocLAR9JbCEE8dNSh3Cr
 oU7TjqHkCLHH2Zq0XVxq4ggQcO9NaZDBCK8sXZVgb6YUF/mYPnPBaKG3hpIbTqoO
 92wKR9s8+gOu5WxArfNY5wgjkkJycf64Tzx9fwuYibmkcWrfHM5TKODKxjLYFmwz
 mB1mkgwNGKg9hvoI/6+nkJeEQHMqv63GDF9/zX04mjekk2BgnQd1YwBxvGiemtIr
 zAt7Nl7XeIevhBEhDEoVEwFunpm+GMqWGEbT2mmQTbP2v87H6X8PR9nbzHjNQQvE
 mwAyJA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm3; bh=cWIJBKUnCDc1IbGyBsYVvdE7RB80OYRO3nQExL1Fr
 SA=; b=f7kgab3qDvdg896eWI2xGL5AOhHDnoRL/u76llBKaC9fYCw/7o6zb98mO
 Ml5O7jZFKTnoX1puvN8iFXHm+VicBmU+tVmpnQB9+jx0/85eSFkRRNBgRdH2AbA5
 /k0jKqQZCU4xL84e85TDBNV5ruR/6fZDw5T6G6gV8WWooXjWeYb+5lk3xigCSkP0
 pQ5mOzdgZ+PsOfjnQWuqA6KdVmE8WXixzipBAZsmH7LRnH3XRCAq+ZHvmIWaLHm8
 f71GpAEsyD244wCQh3Z9T72KzLzMI/3vnKhYK4cJY9olU61eUNOF76MlGIcl+kxC
 nMUElkpYBOQQIVOcrdQuSVG17Mjmw==
X-ME-Sender: <xms:YJv8XjtE61IZKELRjUkTmD0KNgCJTifvQFTThvZqXKFL2CnHIq7prw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrtddvgdejiecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs
 ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf
 frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei
 iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih
 iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho
 nhdrnhgvth
X-ME-Proxy: <xmx:YJv8Xkcr0wXxP4KvqZ4YJQSizd6h-ew9tMXEIA9oXPPZrOSNZyDm9Q>
 <xmx:YJv8XmyPn6LdXTzjCBUE4LR2vawJKvDMDdDAbfD4_Y2ZmeCyf3OhMg>
 <xmx:YJv8XiOFPr2CEEuowbjFYAmvmNU6etdztg_kYc5hJkgkxOdCWJ0yWw>
 <xmx:YJv8XmaEgaZjHoDIV5l57XRG3DF9tl91CBw0crEWMYTslkpkGHNFAQ>
Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id 34E10328005D;
 Wed,  1 Jul 2020 10:19:11 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, david.marchand@redhat.com, ktraynor@redhat.com,
 bluca@debian.org, sunil.pai.g@intel.com,
 Bruce Richardson <bruce.richardson@intel.com>,
 Andrzej Ostruszka <aostruszka@marvell.com>
Date: Wed, 01 Jul 2020 16:19:10 +0200
Message-ID: <4515727.uqIx0n7ttq@thomas>
In-Reply-To: <20200630141433.818517-2-bruce.richardson@intel.com>
References: <20200429100831.398-1-bruce.richardson@intel.com>
 <20200630141433.818517-1-bruce.richardson@intel.com>
 <20200630141433.818517-2-bruce.richardson@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

30/06/2020 16:14, Bruce Richardson:
> 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 <bruce.richardson@intel.com>
> Tested-by: Andrzej Ostruszka <aostruszka@marvell.com>
> Acked-by: Luca Boccassi <bluca@debian.org>
> Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
> ---
> --- a/app/test/meson.build
> +++ b/app/test/meson.build
> -	link_libs = dpdk_drivers
> +	link_libs = dpdk_static_libraries + dpdk_drivers
>  	link_nodes = dpdk_graph_nodes
[...]
> --- a/examples/meson.build
> +++ b/examples/meson.build
> -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

I think the special case for librte_node may be removed.
I will propose a separate patch for this case.

Acked-by: Thomas Monjalon <thomas@monjalon.net>