summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorThomas Monjalon <thomas@monjalon.net>2019-02-12 23:07:05 +0100
committerThomas Monjalon <thomas@monjalon.net>2019-02-24 23:23:57 +0100
commitfdb3798d6f870f79d5fa40b2c3425e8285dd4e44 (patch)
tree2ef964f1d6a28317cc16ff5e039ac460e3852432 /mk
parent7c7b7562252742a6c298de64df486873336fd058 (diff)
downloaddpdk-next-eventdev-fdb3798d6f870f79d5fa40b2c3425e8285dd4e44.zip
dpdk-next-eventdev-fdb3798d6f870f79d5fa40b2c3425e8285dd4e44.tar.gz
dpdk-next-eventdev-fdb3798d6f870f79d5fa40b2c3425e8285dd4e44.tar.xz
mk: fix build of shared library with libbsd
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: stable@dpdk.org Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Diffstat (limited to 'mk')
-rw-r--r--mk/exec-env/linuxapp/rte.vars.mk6
-rw-r--r--mk/rte.app.mk3
-rw-r--r--mk/rte.lib.mk2
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 3129edc..57ee821 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 8a4f0f4..d0ab942 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 c696a21..4df8849 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