From e86a699cf6b1010e74c98284422b79e5e59322f0 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 10 Mar 2016 15:15:59 +0200 Subject: [PATCH] mk: fix shared library dependencies on libm and librt There are two places that need -lm (test app and librte_sched) and exactly one that needs -lrt (librte_sched). Add the relevant DT_NEEDED entries to both, and eliminate the bogus discrepancy between Linux and BSD EXECENV_LDLIBS wrt these libs. Signed-off-by: Panu Matilainen --- app/test/Makefile | 2 ++ lib/librte_sched/Makefile | 3 +++ mk/exec-env/linuxapp/rte.vars.mk | 2 +- mk/rte.app.mk | 8 ++------ 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/test/Makefile b/app/test/Makefile index ec33e1aa85..00e4df2d29 100644 --- a/app/test/Makefile +++ b/app/test/Makefile @@ -160,6 +160,8 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -D_GNU_SOURCE +LDLIBS += -lm + # Disable VTA for memcpy test ifeq ($(CC), gcc) ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1) diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile index b1cb285334..4d631f6a0d 100644 --- a/lib/librte_sched/Makefile +++ b/lib/librte_sched/Makefile @@ -41,6 +41,9 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS_rte_red.o := -D_GNU_SOURCE +LDLIBS += -lm +LDLIBS += -lrt + EXPORT_MAP := rte_sched_version.map LIBABIVER := 1 diff --git a/mk/exec-env/linuxapp/rte.vars.mk b/mk/exec-env/linuxapp/rte.vars.mk index 5fd7d85578..d51bd17034 100644 --- a/mk/exec-env/linuxapp/rte.vars.mk +++ b/mk/exec-env/linuxapp/rte.vars.mk @@ -48,7 +48,7 @@ endif # Workaround lack of DT_NEEDED entry EXECENV_LDFLAGS = --no-as-needed -EXECENV_LDLIBS = -lrt -lm +EXECENV_LDLIBS = EXECENV_ASFLAGS = ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) diff --git a/mk/rte.app.mk b/mk/rte.app.mk index a5a7b1cc69..9dcc4c42e1 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -77,11 +77,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_LPM) += -lrte_lpm _LDLIBS-$(CONFIG_RTE_LIBRTE_POWER) += -lrte_power _LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl _LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter - _LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched -_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm -_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt - _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y) @@ -95,11 +91,11 @@ endif # The static libraries do not know their dependencies. # So linking with static library requires explicit dependencies. ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) - +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt ifeq ($(CONFIG_RTE_NEXT_ABI),y) _LDLIBS-$(CONFIG_RTE_PORT_PCAP) += -lpcap endif - _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lpcap _LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lz _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -libverbs -- 2.20.1