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 4991AA0350;
	Wed,  1 Jul 2020 09:50:26 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 246FA1C195;
	Wed,  1 Jul 2020 09:50:26 +0200 (CEST)
Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com
 [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 8A1921C01E
 for <dev@dpdk.org>; Wed,  1 Jul 2020 09:50:24 +0200 (CEST)
Received: from compute7.internal (compute7.nyi.internal [10.202.2.47])
 by mailout.nyi.internal (Postfix) with ESMTP id D927C5C0096;
 Wed,  1 Jul 2020 03:50:23 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute7.internal (MEProxy); Wed, 01 Jul 2020 03:50:23 -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=
 fRUxmxLqqsC9TIe4aBEEbkVJWboarDweAiyRueLXYII=; b=pDFTxvIremGgwLxB
 CIFjZIQR8qtY2sxi6L+iU81GgAo8lp2KAbxlZ+HBn0gpOIBgo6lIi82nAPUxUX+l
 DniI+kw3oge0dOi1Hk+rXN6c1B5PaI6Y1P0n39DRzTrXMJ8dnV57LbtUGMTpECyV
 htbJ8tqsvjr5x7rEPZfeJJtD3UahsnOXnSVruf5JbhLy6UgG3EIu6owwTr6QND/4
 dRcYH9QuwKZTPR5IyOOcj9toJ3EN2S9Emb/Qs4U1Zujfga8Gt4FR+2ACCoyQgnC5
 rAdsj3Sj/XRsmCWD8izQBLQQDiI4h/88kOglvO004bmZ2Np9/MNVITa0+NdF0qjo
 XK47Sg==
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=fRUxmxLqqsC9TIe4aBEEbkVJWboarDweAiyRueLXY
 II=; b=fqkqnApC1dsSO8xke+G0fozg59VcChl3uv1Yp4O+wGOUSiF6may1Ratvd
 gzq3ixBhpmHEIf+07MxG11fDG7QVZIzKCDNPV2+gzDXI6ZbNl16r3XO16s6jixtk
 8EhjLJ7ClIAXCa7ORBuk84m7a9GIdscJGnGcMXHxE6ISX7uXGfDgdmaYTsXGulvp
 RAUgK+gzyxjeeC0Y0HWAZPZW8x5XQ3A8kMH6sPnifmo0rDELyg6XuRlVnhluhz+/
 A+/Aoe1YmZPBLiNqnYq0MVb2VnecccW8YeRaFa2qRGA/Z6IqgNtR5PRr48W9m1Sb
 +CVJ6RGwABmOPOEigJheryU32SNBA==
X-ME-Sender: <xms:P0D8XjkVDep7BxDBoBGuIHFFPk9_nhWXiZIyFCvn0ZyGHTcTF3LV1w>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrtddugdduvdehucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr
 shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg
 ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu
 ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf
 hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl
 ohhnrdhnvght
X-ME-Proxy: <xmx:P0D8Xm1bJa8Bd7s1ls-PWkPlXK6CHQT_1mempSkTJ02POk5Ax0EY9g>
 <xmx:P0D8Xpoz6OiXG7XryxPsBulXpQajfq3r-S_45doEHhpjYQVjJGzLJg>
 <xmx:P0D8XrnAFSxKRbjNZd7A-rv1s52sDX_jCxPcUJJsUrSsxw2BMg_O1g>
 <xmx:P0D8XvA8_8kXlGNiVSGIyJV-7i2N8R55Sl9_gj0aKY_Q4b9GNalXmw>
Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id 8DF843060061;
 Wed,  1 Jul 2020 03:50:22 -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
Date: Wed, 01 Jul 2020 09:50:20 +0200
Message-ID: <12508772.kpFtruyFWe@thomas>
In-Reply-To: <20200630141433.818517-6-bruce.richardson@intel.com>
References: <20200429100831.398-1-bruce.richardson@intel.com>
 <20200630141433.818517-1-bruce.richardson@intel.com>
 <20200630141433.818517-6-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 5/7] build/pkg-config: output driver libs
	first for static build
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:
> When calling pkg-config --static --libs, pkg-config will always output the
> regular libs first, and then the extra libs from libraries.private field,
> since the assumption is that those are additional dependencies for building
> statically that the .a files depend upon.
> 
> However, for DPDK, we only link the driver files for static builds, and

Sorry, I'm lost here. Why "only" driver files?

> those need to come *before* the regular libraries.

Given whole libs are linked, is it really needed to have drivers first?

> To get this result, we
> need two pkgconfig files for DPDK, one for the shared libs, and a second
> for the static libs and drivers, which depends upon the first. Using a
> dependency means that the shared libs are printed only after the
> libraries.private field rather than before.
> 
> Without this patch, the linking works in DPDK because in all cases we
> specify the libraries after the drivers in the Libs.private line, ensuring
> that the references to the libs from the drivers can be resolved. The
> current output is therefore of the form, "(shared)libs, drivers,
> (static)libs", while after this patch the output is, "drivers,
> (static)libs, (shared)libs". The former case will not work if we use the
> --whole-archive flag on the static libs as it will lead to duplicate
> definitions due to some references having been previously resolved from the
> shared libraries.

I'm completely lost. In which case we link both static and shared libs?

> By ensuring the shared libraries come last in the link
> link, this issue does not occur, as duplicate references when linking the
> shared libs will be ignored.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> Acked-by: Luca Boccassi <bluca@debian.org>
> Acked-by: Sunil Pai G <sunil.pai.g@intel.com>