[dpdk-dev] mk: fix underlinking issues of most librte libraries
Commit Message
The individual libraries have various cross dependencies.
This is already refelcted in the DEPDIR dependency, but not yet in
proper DT_NEEDED flags in the .so's.
This adds the -l flags so that is properly stored in the .so's ELF
headers.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
lib/librte_acl/Makefile | 1 +
lib/librte_cfgfile/Makefile | 1 +
lib/librte_cmdline/Makefile | 1 +
lib/librte_cryptodev/Makefile | 1 +
lib/librte_distributor/Makefile | 1 +
lib/librte_ether/Makefile | 1 +
lib/librte_hash/Makefile | 1 +
lib/librte_ip_frag/Makefile | 1 +
lib/librte_ivshmem/Makefile | 1 +
lib/librte_jobstats/Makefile | 1 +
lib/librte_kni/Makefile | 1 +
lib/librte_kvargs/Makefile | 1 +
lib/librte_lpm/Makefile | 1 +
lib/librte_mbuf/Makefile | 1 +
lib/librte_mempool/Makefile | 1 +
lib/librte_meter/Makefile | 1 +
lib/librte_pipeline/Makefile | 1 +
lib/librte_port/Makefile | 1 +
lib/librte_power/Makefile | 1 +
lib/librte_reorder/Makefile | 1 +
lib/librte_ring/Makefile | 1 +
lib/librte_sched/Makefile | 1 +
lib/librte_table/Makefile | 3 +++
lib/librte_timer/Makefile | 1 +
lib/librte_vhost/Makefile | 1 +
25 files changed, 27 insertions(+)
Comments
2016-05-20 18:50, Christian Ehrhardt:
> The individual libraries have various cross dependencies.
> This is already refelcted in the DEPDIR dependency, but not yet in
> proper DT_NEEDED flags in the .so's.
> This adds the -l flags so that is properly stored in the .so's ELF
> headers.
Why not filling LDLIBS by parsing DEPDIRS-y in rte.lib.mk?
@@ -91,6 +91,7 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_ACL)-include := rte_acl_osdep.h
SYMLINK-$(CONFIG_RTE_LIBRTE_ACL)-include += rte_acl.h
# this lib needs eal
+LDLIBS += -lrte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_ACL) += lib/librte_eal
include $(RTE_SDK)/mk/rte.lib.mk
@@ -52,6 +52,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CFGFILE) += rte_cfgfile.c
SYMLINK-$(CONFIG_RTE_LIBRTE_CFGFILE)-include += rte_cfgfile.h
# this lib needs eal
+LDLIBS += -lrte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_CFGFILE) += lib/librte_eal
include $(RTE_SDK)/mk/rte.lib.mk
@@ -62,6 +62,7 @@ INCS += cmdline_vt100.h cmdline_socket.h cmdline_cirbuf.h cmdline_parse_portlist
SYMLINK-$(CONFIG_RTE_LIBRTE_CMDLINE)-include := $(INCS)
# this lib needs eal
+LDLIBS += -lrte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += lib/librte_eal
include $(RTE_SDK)/mk/rte.lib.mk
@@ -53,6 +53,7 @@ SYMLINK-y-include += rte_cryptodev_pmd.h
EXPORT_MAP := rte_cryptodev_version.map
# library dependencies
+LDLIBS += -lrte_eal -lrte_mempool -lrte_ring -lrte_mbuf -lrte_kvargs
DEPDIRS-y += lib/librte_eal
DEPDIRS-y += lib/librte_mempool
DEPDIRS-y += lib/librte_ring
@@ -48,6 +48,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) := rte_distributor.c
SYMLINK-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR)-include := rte_distributor.h
# this lib needs eal
+LDLIBS += -lrte_eal -lrte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += lib/librte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += lib/librte_mbuf
@@ -54,6 +54,7 @@ SYMLINK-y-include += rte_eth_ctrl.h
SYMLINK-y-include += rte_dev_info.h
# this lib depends upon:
+LDLIBS += -lrte_eal -lrte_mempool -lrte_ring -lrte_mbuf
DEPDIRS-y += lib/librte_eal lib/librte_mempool lib/librte_ring lib/librte_mbuf
include $(RTE_SDK)/mk/rte.lib.mk
@@ -56,6 +56,7 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_thash.h
SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_fbk_hash.h
# this lib needs eal and ring
+LDLIBS += -lrte_eal -lrte_ring
DEPDIRS-$(CONFIG_RTE_LIBRTE_HASH) += lib/librte_eal lib/librte_ring
include $(RTE_SDK)/mk/rte.lib.mk
@@ -54,6 +54,7 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_IP_FRAG)-include += rte_ip_frag.h
# this library depends on rte_ether
+LDLIBS += -lrte_mempool -lethdev
DEPDIRS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += lib/librte_mempool lib/librte_ether
include $(RTE_SDK)/mk/rte.lib.mk
@@ -47,6 +47,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_IVSHMEM) := rte_ivshmem.c
SYMLINK-$(CONFIG_RTE_LIBRTE_IVSHMEM)-include := rte_ivshmem.h
# this lib needs eal
+LDLIBS += -lrte_mempool
DEPDIRS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += lib/librte_mempool
include $(RTE_SDK)/mk/rte.lib.mk
@@ -48,6 +48,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_JOBSTATS) := rte_jobstats.c
SYMLINK-$(CONFIG_RTE_LIBRTE_JOBSTATS)-include := rte_jobstats.h
# this lib needs eal
+LDLIBS += -lrte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_JOBSTATS) += lib/librte_eal
include $(RTE_SDK)/mk/rte.lib.mk
@@ -47,6 +47,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_KNI) := rte_kni.c
SYMLINK-$(CONFIG_RTE_LIBRTE_KNI)-include := rte_kni.h
# this lib needs eal
+LDLIBS += -lrte_eal -lrte_mbuf -lethdev
DEPDIRS-$(CONFIG_RTE_LIBRTE_KNI) += lib/librte_eal lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_KNI) += lib/librte_ether
@@ -50,6 +50,7 @@ INCS := rte_kvargs.h
SYMLINK-$(CONFIG_RTE_LIBRTE_KVARGS)-include := $(INCS)
# this lib needs eal
+LDLIBS += -lrte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_KVARGS) += lib/librte_eal
include $(RTE_SDK)/mk/rte.lib.mk
@@ -54,6 +54,7 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_LPM)-include += rte_lpm_sse.h
endif
# this lib needs eal
+LDLIBS += -lrte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_LPM) += lib/librte_eal
include $(RTE_SDK)/mk/rte.lib.mk
@@ -47,6 +47,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_MBUF) := rte_mbuf.c
SYMLINK-$(CONFIG_RTE_LIBRTE_MBUF)-include := rte_mbuf.h
# this lib needs eal
+LDLIBS += -lrte_eal -lrte_mempool
DEPDIRS-$(CONFIG_RTE_LIBRTE_MBUF) += lib/librte_eal lib/librte_mempool
include $(RTE_SDK)/mk/rte.lib.mk
@@ -45,6 +45,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += rte_mempool.c
# install includes
SYMLINK-$(CONFIG_RTE_LIBRTE_MEMPOOL)-include := rte_mempool.h
+LDLIBS += -lrte_eal -lrte_ring
DEPDIRS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += lib/librte_eal lib/librte_ring
include $(RTE_SDK)/mk/rte.lib.mk
@@ -54,6 +54,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_METER) := rte_meter.c
SYMLINK-$(CONFIG_RTE_LIBRTE_METER)-include := rte_meter.h
# this lib depends upon:
+LDLIBS += -lrte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_METER) += lib/librte_eal
include $(RTE_SDK)/mk/rte.lib.mk
@@ -52,6 +52,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PIPELINE) := rte_pipeline.c
SYMLINK-$(CONFIG_RTE_LIBRTE_PIPELINE)-include += rte_pipeline.h
# this lib depends upon:
+LDLIBS += -lrte_table -lrte_port
DEPDIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) := lib/librte_table
DEPDIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += lib/librte_port
@@ -70,6 +70,7 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_PORT)-include += rte_port_sched.h
SYMLINK-$(CONFIG_RTE_LIBRTE_PORT)-include += rte_port_source_sink.h
# this lib depends upon:
+LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lethdev -lrte_ip_frag
DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) := lib/librte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) += lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) += lib/librte_mempool
@@ -48,6 +48,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_POWER) += rte_power_kvm_vm.c guest_channel.c
SYMLINK-$(CONFIG_RTE_LIBRTE_POWER)-include := rte_power.h
# this lib needs eal
+LDLIBS += -lrte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_POWER) += lib/librte_eal
include $(RTE_SDK)/mk/rte.lib.mk
@@ -48,6 +48,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_REORDER) := rte_reorder.c
SYMLINK-$(CONFIG_RTE_LIBRTE_REORDER)-include := rte_reorder.h
# this lib depends upon:
+LDLIBS += -lrte_eal -lrte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_REORDER) += lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_REORDER) += lib/librte_eal
@@ -46,6 +46,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_RING) := rte_ring.c
# install includes
SYMLINK-$(CONFIG_RTE_LIBRTE_RING)-include := rte_ring.h
+LDLIBS += -lrte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_RING) += lib/librte_eal
include $(RTE_SDK)/mk/rte.lib.mk
@@ -59,6 +59,7 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_SCHED)-include := rte_sched.h rte_bitmap.h rte_sched
SYMLINK-$(CONFIG_RTE_LIBRTE_SCHED)-include += rte_reciprocal.h
# this lib depends upon:
+LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_timer
DEPDIRS-$(CONFIG_RTE_LIBRTE_SCHED) += lib/librte_mempool lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_SCHED) += lib/librte_net lib/librte_timer
@@ -72,14 +72,17 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_TABLE)-include += rte_table_array.h
SYMLINK-$(CONFIG_RTE_LIBRTE_TABLE)-include += rte_table_stub.h
# this lib depends upon:
+LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_port -lrte_lpm
DEPDIRS-$(CONFIG_RTE_LIBRTE_TABLE) := lib/librte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_TABLE) += lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_TABLE) += lib/librte_mempool
DEPDIRS-$(CONFIG_RTE_LIBRTE_TABLE) += lib/librte_port
DEPDIRS-$(CONFIG_RTE_LIBRTE_TABLE) += lib/librte_lpm
ifeq ($(CONFIG_RTE_LIBRTE_ACL),y)
+LDLIBS += -lrte_acl
DEPDIRS-$(CONFIG_RTE_LIBRTE_TABLE) += lib/librte_acl
endif
+LDLIBS += -lrte_hash
DEPDIRS-$(CONFIG_RTE_LIBRTE_TABLE) += lib/librte_hash
include $(RTE_SDK)/mk/rte.lib.mk
@@ -47,6 +47,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_TIMER) := rte_timer.c
SYMLINK-$(CONFIG_RTE_LIBRTE_TIMER)-include := rte_timer.h
# this lib needs eal
+LDLIBS += -lrte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_TIMER) += lib/librte_eal
include $(RTE_SDK)/mk/rte.lib.mk
@@ -63,6 +63,7 @@ endif
SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_virtio_net.h
# dependencies
+LDLIBS += -lrte_eal -lethdev -lrte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_VHOST) += lib/librte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_VHOST) += lib/librte_ether
DEPDIRS-$(CONFIG_RTE_LIBRTE_VHOST) += lib/librte_mbuf