From: Kefu Chai Date: Fri, 1 Jul 2016 03:09:09 +0000 (+0800) Subject: cmake: remove unnecessary linked libs from libcephfs X-Git-Tag: ses5-milestone5~536^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=27cb0a121ee97989ac79fd58085c177f09d9f002;p=ceph.git cmake: remove unnecessary linked libs from libcephfs * some of the libs shares the same .cc which has static C++ variables. if we link against the different libs sharing the same static C++ variables, and the dtor of the C++ variables has side-effects, among other things, deallocates a memory chunk. then, we are in the trouble of double free. so "osd" lib is removed. * some of the libs are referenced by the linked lib, so no need to link against them again. for example, BLKID_LIBRARIES are linked by libcommon, so we can remove it from the linked libs list. * and lib "os" and "cls_references_objs" are not used by libcephfs at all, so remove them. Fixes: http://tracker.ceph.com/issues/16556 Signed-off-by: Kefu Chai --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e60e2839df94..186b01f68556 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1157,10 +1157,8 @@ if(WITH_LIBCEPHFS) target_link_libraries(client osdc mds) set(libcephfs_srcs libcephfs.cc) add_library(cephfs ${CEPH_SHARED} ${libcephfs_srcs} - $ $) - target_link_libraries(cephfs LINK_PRIVATE client osdc osd os global common - ${BLKID_LIBRARIES} + target_link_libraries(cephfs LINK_PRIVATE client ${CRYPTO_LIBS} ${EXTRALIBS}) if(ENABLE_SHARED) set_target_properties(cephfs PROPERTIES