From: Thomas Monjalon <thomas@monjalon.net>
Cc: dev@dpdk.org, bruce.richardson@intel.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH 1/4] mk: fix build of shared library with libbsd
Date: Wed, 13 Feb 2019 00:05:04 +0100 [thread overview]
Message-ID: <20190212230507.11793-2-thomas@monjalon.net> (raw)
In-Reply-To: <20190212230507.11793-1-thomas@monjalon.net>
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 <thomas@monjalon.net>
---
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
next prev parent reply other threads:[~2019-02-12 23:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-12 23:05 [dpdk-dev] [PATCH 0/4] fix test of some build options Thomas Monjalon
2019-02-12 23:05 ` Thomas Monjalon [this message]
2019-02-12 23:05 ` [dpdk-dev] [PATCH 2/4] devtools: add libelf dependency to build test Thomas Monjalon
2019-02-12 23:05 ` [dpdk-dev] [PATCH 3/4] devtools: test build of zlib PMD Thomas Monjalon
2019-02-12 23:05 ` [dpdk-dev] [PATCH 4/4] devtools: fix test of some build options Thomas Monjalon
2019-02-13 18:22 ` Trahe, Fiona
2019-02-24 22:24 ` [dpdk-dev] [PATCH 0/4] " Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190212230507.11793-2-thomas@monjalon.net \
--to=thomas@monjalon.net \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).