Skip to content

Commit

Permalink
cmake: remove unnecessary linked libs from libcephfs
Browse files Browse the repository at this point in the history
* 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 <kchai@redhat.com>
  • Loading branch information
tchaikov committed Jul 1, 2016
1 parent 85bb43e commit 27cb0a1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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_OBJECTS:cls_references_objs>
$<TARGET_OBJECTS:common_util_obj>)
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
Expand Down

0 comments on commit 27cb0a1

Please sign in to comment.