From 32f967b420a5e2f58844f559731a8f8f1b123705 Mon Sep 17 00:00:00 2001 From: luo rixin Date: Thu, 28 Nov 2019 20:18:09 +0800 Subject: [PATCH] cmake: Add shared library as dpdk dependency librte_eal.a refers to libpthread.so and libdl.so, and libceph-common.so refers to librte_eal.a. Many test application link libceph-common.so without linking pthread, it will cause link error. Such as unittest_interval_set, target_link_libraries (unittest_interval_set ceph-common) Signed-off-by: Chunsong Feng --- cmake/modules/BuildDPDK.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/BuildDPDK.cmake b/cmake/modules/BuildDPDK.cmake index 30f2aea0e4bcf..e324d2f0a09b9 100644 --- a/cmake/modules/BuildDPDK.cmake +++ b/cmake/modules/BuildDPDK.cmake @@ -176,7 +176,7 @@ function(do_export_dpdk dpdk_dir) set_target_properties(dpdk::dpdk PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${DPDK_INCLUDE_DIR} INTERFACE_LINK_LIBRARIES - "-Wl,--whole-archive $ -Wl,--no-whole-archive ${dpdk_numa}") + "-Wl,--whole-archive $ -Wl,--no-whole-archive ${dpdk_numa} -Wl,-lpthread,-ldl") if(dpdk_rte_CFLAGS) set_target_properties(dpdk::dpdk PROPERTIES INTERFACE_COMPILE_OPTIONS "${dpdk_rte_CFLAGS}") -- 2.39.5