Skip to content

Commit

Permalink
fix meson build failure problem
Browse files Browse the repository at this point in the history
Signed-off-by: ywc689 <[email protected]>
  • Loading branch information
ywc689 committed Jun 24, 2021
1 parent b8da933 commit 6741ce9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ $ mkdir [user desired build folder - dpdkbuild]
$ meson -Dprefix=[dpdklib] dpdkbuild
$ ninja -C dpdkbuild
$ cd dpdkbuild; ninja install
$ export PKG_CONFIG_PATH=${PKG_CONFIG_PATH:+$PKG_CONFIG_PATH:}$(pwd)/../dpdklib/lib64/pkgconfig/libdpdk.pc
```

2. Using Makefile for build DPDK linraries and export `RTE_SDK` env variable for DPDK app (DPVS).
Expand Down
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ifeq ($(RTE_SDK),)
$(error "The variable RTE_SDK is not defined.")
endif
include $(RTE_SDK)/mk/rte.vars.mk
LIBS += -lpthread -lnuma
LIBS += -lpthread -lnuma -lrt -lm -ldl -lcrypto -lpcap
endif

include $(SRCDIR)/config.mk
Expand All @@ -67,7 +67,7 @@ else
endif


CFLAGS += $(INCDIRS) $(LIBS)
CFLAGS += $(INCDIRS)

OBJS := $(shell find $(SRCDIR) -name '*.c' | sort)
OBJS := $(patsubst %.c,%.o,$(OBJS))
Expand Down
4 changes: 4 additions & 0 deletions src/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ endif
GCC_MAJOR = $(shell echo __GNUC__ | $(CC) -E -x c - | tail -n 1)
GCC_MINOR = $(shell echo __GNUC_MINOR__ | $(CC) -E -x c - | tail -n 1)
GCC_VERSION = $(GCC_MAJOR)$(GCC_MINOR)

ifeq ($(CONFIG_MLX5), y)
LIBS += -libverbs -lmlx5 -lmnl
endif
21 changes: 10 additions & 11 deletions src/dpdk.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ CFLAGS += -include $(DPDKDIR)/include/rte_config.h

LIBS += -L $(DPDKDIR)/lib

LIBS += -Wl,--no-as-needed -fvisibility=default \
-Wl,--whole-archive -lrte_pmd_vmxnet3_uio -lrte_pmd_i40e -lrte_pmd_ixgbe -lrte_pmd_ena \
-lrte_pmd_e1000 -lrte_pmd_bnxt -lrte_pmd_ring -lrte_pmd_bond -lrte_ethdev -lrte_ip_frag \
-Wl,--whole-archive -lrte_hash -lrte_kvargs -Wl,-lrte_mbuf -lrte_eal \
-Wl,-lrte_mempool -lrte_ring -lrte_cmdline -lrte_cfgfile -lrte_kni \
-lrte_mempool_ring -lrte_timer -lrte_net -Wl,-lrte_pmd_virtio \
LIBS += -Wl,--no-as-needed -fvisibility=default -Wl,--whole-archive

LIBS += -lrte_pmd_vmxnet3_uio -lrte_pmd_i40e -lrte_pmd_ixgbe -lrte_pmd_ena \
-lrte_pmd_e1000 -lrte_pmd_bnxt -lrte_pmd_ring -lrte_pmd_bond \
-lrte_ethdev -lrte_ip_frag -lrte_hash -lrte_kvargs -lrte_mbuf \
-lrte_eal -lrte_mempool -lrte_ring -lrte_cmdline -lrte_cfgfile \
-lrte_kni -lrte_mempool_ring -lrte_timer -lrte_net -lrte_pmd_virtio \
-lrte_pci -lrte_bus_pci -lrte_bus_vdev -lrte_lpm -lrte_pdump \
-Wl,--no-whole-archive -lrt -lm -ldl -lcrypto

ifeq ($(CONFIG_PDUMP), y)
LIBS += -Wl,--whole-archive -lrte_acl -lrte_member -lrte_eventdev -lrte_reorder -lrte_cryptodev \
LIBS += -lrte_acl -lrte_member -lrte_eventdev -lrte_reorder -lrte_cryptodev \
-lrte_vhost -lrte_pmd_pcap

ifneq ("$(wildcard $(RTE_SDK)/$(RTE_TARGET)/lib/librte_bus_vmbus.a)", "")
Expand All @@ -56,12 +56,11 @@ ifneq ("$(wildcard $(RTE_SDK)/$(RTE_TARGET)/lib/librte_pmd_netvsc.a)", "")
LIBS += -lrte_pmd_netvsc
endif

LIBS += -Wl,--no-whole-archive -lpcap
endif

ifeq ($(CONFIG_MLX5), y)
LIBS += -Wl,--whole-archive -lrte_pmd_mlx5 -Wl,--no-whole-archive
LIBS += -libverbs -lmlx5 -lmnl
LIBS += -lrte_pmd_mlx5
endif

LIBS += -Wl,--no-whole-archive
endif

0 comments on commit 6741ce9

Please sign in to comment.