From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id D72077D05; Wed, 13 Feb 2019 00:05:15 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 77C7E21E71; Tue, 12 Feb 2019 18:05:15 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 12 Feb 2019 18:05:15 -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=OE9GpjkJLv SsWeJxBXjiVIdlJA18q6Vwf4tILS8RmwQ=; b=Tsd+rgFCyHrzS6z/F+Zm7oK0ur X76MwlAhkcP8QUKWntbaCG7ibVp17IM1BuqgpWYWXUTZUkRumbrPA5N0/V+2KGXz R8wWhaFOhtwKz2QKW+HZRskmq4a0jJda0ic/lueymVCRi52DXPBWEvAvMM/Q92ja sEbkVE3yazA+9ASLo= 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=OE9GpjkJLvSsWeJxBXjiVIdlJA18q6Vwf4tILS8RmwQ=; b=cLoto1lj I8kgwaFkhaERcNSVKreOwr80kZIQ/M61sUqYDa785OwVZrgFuWzqw2TEItqLZ78t Oqt5DG9lX7Ytv/9ACt/9tmXBQCWjgqTLuC3SETc5GHctpXyevLSnOcgk9llEz5L2 ikvhVMCxRYjr2vjpsXT+Ypd0sPWOyAkufZB93d/X99keEH+9qRd6Xf3qUAzN69qY dzdhUzFqLLs+G+YHlLDHzBUjL/FXPntKiIK6MEewdraapnnMu6YDXk9ZSOzKoJxt AJoyn6MEbB8daXVTPAnsipSlvRdWSASxY/x1MhqSvbAug98+Iu3yX4XiPqGFH5Ju 7teijmbLOmU/VA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtvddgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecumhhishhsihhnghcuvffquchfihgvlhguucdlfedtmdenucfjughrpefhvffuff fkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhho nhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucffohhmrghinhepvhgrrh hsrdhmkhdplhhisgdrmhhknecukfhppeejjedrudefgedrvddtfedrudekgeenucfrrghr rghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvthenucevlh hushhtvghrufhiiigvpedt 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 60859E409D; Tue, 12 Feb 2019 18:05:14 -0500 (EST) From: Thomas Monjalon To: Cc: dev@dpdk.org, bruce.richardson@intel.com, stable@dpdk.org Date: Wed, 13 Feb 2019 00:05:04 +0100 Message-Id: <20190212230507.11793-2-thomas@monjalon.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190212230507.11793-1-thomas@monjalon.net> References: <20190212230507.11793-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 1/4] mk: fix build of shared library with libbsd 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: , X-List-Received-Date: Tue, 12 Feb 2019 23:05:16 -0000 When building DPDK with "make" and options CONFIG_RTE_USE_LIBBSD=y and CONFIG_RTE_BUILD_SHARED_LIB=y libbsd was not linked, resulting in compilation errors: undefined reference to `strlcpy' The link option -lbsd is added in a common place for both Linux apps and libs. It is used in app linkage via EXECENV_LDLIBS, and in lib linkage via the added variable EXECENV_LDLIBS-y. Fixes: 5364de644a4b ("eal: support strlcpy function") Cc: bruce.richardson@intel.com Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- mk/exec-env/linuxapp/rte.vars.mk | 6 ++++++ mk/rte.app.mk | 3 --- mk/rte.lib.mk | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mk/exec-env/linuxapp/rte.vars.mk b/mk/exec-env/linuxapp/rte.vars.mk index 3129edc8c..57ee82150 100644 --- a/mk/exec-env/linuxapp/rte.vars.mk +++ b/mk/exec-env/linuxapp/rte.vars.mk @@ -24,6 +24,8 @@ ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) EXECENV_LDLIBS += -lgcc_s endif +EXECENV_LDLIBS-$(CONFIG_RTE_USE_LIBBSD) += -lbsd + # force applications to link with gcc/icc instead of using ld LINK_USING_CC := 1 @@ -32,4 +34,8 @@ EXECENV_LDFLAGS += -export-dynamic # Add library to the group to resolve symbols EXECENV_LDLIBS += -ldl +# EXECENV_LDLIBS-y applies to lib.so and app linking +# while EXECENV_LDLIBS applies only to app linking. +EXECENV_LDLIBS += $(EXECENV_LDLIBS-y) + export EXECENV_CFLAGS EXECENV_LDFLAGS EXECENV_ASFLAGS EXECENV_LDLIBS diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 8a4f0f4e5..d0ab942d5 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -309,9 +309,6 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrt ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP)$(CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES),yy) _LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lnuma endif -ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP)$(CONFIG_RTE_USE_LIBBSD),yy) -_LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lbsd -endif _LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm _LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt _LDLIBS-$(CONFIG_RTE_LIBRTE_MEMBER) += -lm diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk index c696a2174..4df8849a0 100644 --- a/mk/rte.lib.mk +++ b/mk/rte.lib.mk @@ -35,6 +35,8 @@ PREINSTALL = $(SYMLINK-FILES-y) _INSTALL = $(INSTALL-FILES-y) $(RTE_OUTPUT)/lib/$(LIB) _CLEAN = doclean +LDLIBS += $(EXECENV_LDLIBS-y) + .PHONY: all all: install -- 2.20.1