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 EEDF8A051F for ; Wed, 10 Jun 2020 16:02:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9EB591C01; Wed, 10 Jun 2020 16:02:21 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 33EA51C01 for ; Wed, 10 Jun 2020 16:02:20 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 8E5625C009C; Wed, 10 Jun 2020 10:02:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 10 Jun 2020 10:02:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm1; bh=DnPzGYLa146zfADFlCi6ywF26s w3a5gKMuH9qY9Hga4=; b=jCjO6CkOb1R4uuII/P/29Qd1boPu8hrT2NohVzhjxi DL73XWFl1zYsdZIfinMHliQxTUEx5MeCi0IwC0lN+uDFUzL6bsjezPgKhM2KkMrG rlnecLgQ/YZzQ+s72XdEdWLjNtQVKOr0Cwg7VXpitEMJkV4Ig/eZJtpNWQDcKgzN 73fL6es3LcCIpdhACHE0LvSOX3lgeHXWjBBrS9bS7OdFNNxl2hY5P3z8Eh+cxBPX oiZWVKX7gP6Pzes78tW/IvR1YZrtAxxoVTQU8eO25gYnfHUdaoqGMn6pjl0Ao9nQ 90c7okBS9Fnqu90op2LTO9wkZE4Q/Z0iprOt5L9T9Nyg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=DnPzGYLa146zfADFl Ci6ywF26sw3a5gKMuH9qY9Hga4=; b=IQtBvfjglbPWIDySGq9SOfPqqecKnsf0J skeirravjDW7YJb9DunEr4SybPI9opq6y7mDtABSOrkWX891ZJuDCuEy7POqPczu iRht3MgZhR7nt2t7StVdE1q5uYJa99SYyuoq+q/aTb2akv3aXOP4PZOYoVo4sNfX Xc3Lyd/8UIZYlNyGqpUAnSoIdsVs3YcEJgKrPuN9Ro2epluHASJ/90Y0zd5yhTtk o/EnCTsw3VeE60qoTBR02prNG/T4wCMF+aLzH3owKExZ7wUF0KfKcraPZYJz89iK ZUTQPt/nPqRv7o7Yp8Srsi0y4quQDqFuJm7kypO8H+aQ9WVZy6TRQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudehiedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgrshcu ofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecuggftrf grthhtvghrnhepvdelvdduhedvudduveeuvdevheegudelgeeigfejheduhedttdegudff jeeihffgnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhn rdhnvght X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 4A7FD3060FE7; Wed, 10 Jun 2020 10:02:18 -0400 (EDT) From: Thomas Monjalon To: stable@dpdk.org Cc: bluca@debian.org, Bruce Richardson , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko Date: Wed, 10 Jun 2020 16:02:09 +0200 Message-Id: <20200610140209.3576455-1-thomas@monjalon.net> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH 19.11] buildtools: get static mlx dependencies for meson X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" [ upstream commit 2cca60310a0bca86483e3b62a1143a50f7484069 ] The shell script options-ibverbs-static.sh was used with make in forcing static linkage of ibverbs libraries. When choosing to link with a static dependency in meson, the generated .pc file will not force such static linkage. The solution will rely on using this script in meson. If linking with libraries installed in a non-standard path, an option -L is provided via EXTRA_LDFLAGS in case of using make. With meson, tuning PKG_CONFIG_PATH for pkg-config should be enough. When statically linking an application, the .pc file must save the -L path so the application link will work without any extra option. That's why --libs-only-l is replaced with --libs which includes -L. Options which are neither -l or -L are filtered out because not needed and can cause compilation issues with the legacy system using make. The other change in this script is to drop the first occurrences of the main library file (libiverbs.a). Only the last occurrence is kept. It fixes some undefined references when linking a static application using libdpdk.pc. Signed-off-by: Thomas Monjalon Acked-by: Bruce Richardson --- The patches net/mlx: add static ibverbs linkage with meson and net/mlx: workaround static linkage with meson were backported in 19.11 without this patch, so static ibverbs linkage with meson is broken (libs not found). --- buildtools/options-ibverbs-static.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/buildtools/options-ibverbs-static.sh b/buildtools/options-ibverbs-static.sh index 0f285a343b..0740a711ff 100755 --- a/buildtools/options-ibverbs-static.sh +++ b/buildtools/options-ibverbs-static.sh @@ -9,6 +9,13 @@ # # PKG_CONFIG_PATH may be required to be set if libibverbs.pc is not installed. -pkg-config --libs-only-l --static libibverbs | +lib='libibverbs' +deps='pthread|nl' + +pkg-config --libs --static $lib | tr '[:space:]' '\n' | - sed -r '/^-l(pthread|nl)/! s,(^-l)(.*),\1:lib\2.a,' + sed -r "/^-l($deps)/! s,(^-l)(.*),\1:lib\2.a," | # explicit .a + sed -n '/^-[Ll]/p' | # extra link options may break with make + tac | + awk "/^-l:$lib.a/&&c++ {next} 1" | # drop first duplicates of main lib + tac -- 2.26.2