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 1D146A0530; Wed, 12 Feb 2020 03:00:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 909B21BF81; Wed, 12 Feb 2020 03:00:08 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 49B101BE94; Wed, 12 Feb 2020 03:00:07 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D402721AF2; Tue, 11 Feb 2020 21:00:06 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 11 Feb 2020 21:00:06 -0500 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; s=mesmtp; bh=Oqvfp4dU2+ 1Kj2rYONPQvR5aPvGDRT8q39h+cxSkE7A=; b=MHdrEgkLxMOmt8SF16dVv0c+3c AeByRJeThB/8Vx+uOpx4pV8UqvzlLtMnGJFhAMzNgPKpdlDGEby3AYNl+FdUKVHq 5slZ2f+Ups5GOU/dxulJoGZcNjrXrYvlmOB9ievUrBfkkEraJ7kXCZm+PeLzdiig AxgS4KfDv7qeYfoqU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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= fm2; bh=Oqvfp4dU2+1Kj2rYONPQvR5aPvGDRT8q39h+cxSkE7A=; b=TSUheAm1 QERwlfxsnkkqe2Sh9pkjs2boR6Ul2aNXChSCPZBA+x2eLC7ATRDGbVJPyyJDgg05 vuc0aDQ9AIbSIqhMmHorsUMs92ArroxPmOEh0s//gA7IfcqncWDCoPpLepOlqDTj DLS32L/ojO1imJKA/IlMyiQNJmhNOLxery7ZtkdmCgQqDQyZbknuIzuXvS/oAuw6 1YuQdkC1Z8MHSTDU3EZ+UDS7LWX1WpiBF64auToXrllQy1jhYr8UpOP5LIxnO4rv rAuYTMBe2D8yBd16Dtu9J1fjlZE++0Hiq5q/zYH5Lq3x50Zoi7N71co3y8H6nh5J 8QaEEhrXMfsVjQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieeggdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgepheenucfrrghr rghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth 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 B5777328005E; Tue, 11 Feb 2020 21:00:05 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: bruce.richardson@intel.com, stable@dpdk.org, Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , =?UTF-8?q?N=C3=A9lio=20Laranjeiro?= Date: Wed, 12 Feb 2020 02:59:44 +0100 Message-Id: <20200212015944.3037000-7-thomas@monjalon.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200212015944.3037000-1-thomas@monjalon.net> References: <20200116071656.1663967-1-thomas@monjalon.net> <20200212015944.3037000-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 6/6] net/mlx: fix overlinking with meson and glue dlopen 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" If ibverbs_link is dlopen, the PMD and application should not be linked with ibverbs, but the glue library is. Unfortunately the ibverbs dependency was exported in the variable ext_deps, so there were overlinking. It is fixed by not exporting the dependency in ext_deps, and recreating a limited dependency object for cflags only. Fixes: 1dd7c7e38c19 ("net/mlx4: support meson build") Fixes: 96d7c62a70c7 ("net/mlx5: support meson build") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- drivers/common/mlx5/meson.build | 6 ++++-- drivers/net/mlx4/meson.build | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build index 0fe086136a..cfc178257d 100644 --- a/drivers/common/mlx5/meson.build +++ b/drivers/common/mlx5/meson.build @@ -29,7 +29,7 @@ foreach libname:libnames endif if lib.found() libs += lib - if not static_ibverbs + if not static_ibverbs and not dlopen_ibverbs ext_deps += lib endif else @@ -38,10 +38,12 @@ foreach libname:libnames subdir_done() endif endforeach -if static_ibverbs +if static_ibverbs or dlopen_ibverbs # Build without adding shared libs to Requires.private ibv_cflags = run_command(pkgconf, '--cflags', 'libibverbs').stdout() ext_deps += declare_dependency(compile_args: ibv_cflags.split()) +endif +if static_ibverbs # Add static deps ldflags to internal apps and Libs.private ibv_ldflags = run_command(ldflags_ibverbs_static, check:true).stdout() ext_deps += declare_dependency(link_args:ibv_ldflags.split()) diff --git a/drivers/net/mlx4/meson.build b/drivers/net/mlx4/meson.build index f66e70f4d1..c598745730 100644 --- a/drivers/net/mlx4/meson.build +++ b/drivers/net/mlx4/meson.build @@ -30,7 +30,7 @@ foreach libname:libnames endif if lib.found() libs += lib - if not static_ibverbs + if not static_ibverbs and not dlopen_ibverbs ext_deps += lib endif else @@ -39,10 +39,12 @@ foreach libname:libnames subdir_done() endif endforeach -if static_ibverbs +if static_ibverbs or dlopen_ibverbs # Build without adding shared libs to Requires.private ibv_cflags = run_command(pkgconf, '--cflags', 'libibverbs').stdout() ext_deps += declare_dependency(compile_args: ibv_cflags.split()) +endif +if static_ibverbs # Add static deps ldflags to internal apps and Libs.private ibv_ldflags = run_command(ldflags_ibverbs_static, check:true).stdout() ext_deps += declare_dependency(link_args:ibv_ldflags.split()) -- 2.25.0