]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: exclude private symbols in librbd
authorKefu Chai <kchai@redhat.com>
Fri, 29 Jul 2016 03:27:34 +0000 (11:27 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 29 Jul 2016 15:12:33 +0000 (23:12 +0800)
missed it in 0edfad0.
* librbd: pass '--exclude-libs,ALL' to linker
* rbd: link against used libraries explicitly, rbd is accessing some
  internal symbols not exposed by librbd.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/cls/CMakeLists.txt
src/journal/CMakeLists.txt
src/librbd/CMakeLists.txt
src/rbd_fuse/CMakeLists.txt
src/test/librbd/CMakeLists.txt
src/tools/rbd/CMakeLists.txt

index 659662726c855329391733ff6493d0278ede2804..185da04f7f8c5846c7e8fd2652f1a2ff53244063 100644 (file)
@@ -19,6 +19,7 @@ if (WITH_RBD)
   install(TARGETS cls_rbd DESTINATION ${cls_dir})
 
   add_library(cls_rbd_client STATIC rbd/cls_rbd_client.cc rbd/cls_rbd_types.cc)
+  target_link_libraries(cls_rbd_client cls_lock_client)
 endif (WITH_RBD)
 
 # cls_lock
index e5337127200d17bd92cc18a63dc7ce2373562378..50b8c307cb28b8fdb73aff3771473337660fa164 100644 (file)
@@ -12,3 +12,4 @@ set(journal_srcs
   ObjectRecorder.cc
   Utils.cc)
 add_library(journal STATIC ${journal_srcs})
+target_link_libraries(journal cls_journal_client)
index a08f17d61377ea957cd4a063f22b4ca0799eb535..216f76d666f5c01aabe160dc5c5a1fa2d5531aab 100644 (file)
@@ -98,6 +98,7 @@ if(ENABLE_SHARED)
     OUTPUT_NAME rbd
     VERSION 1.0.0
     SOVERSION 1
-    COMPILE_FLAGS "-fvisibility=hidden -fvisibility-inlines-hidden")
+    COMPILE_FLAGS "-fvisibility=hidden -fvisibility-inlines-hidden"
+    LINK_FLAGS "-Wl,--exclude-libs,ALL")
 endif(ENABLE_SHARED)
 install(TARGETS librbd DESTINATION ${CMAKE_INSTALL_LIBDIR})
index efeda706cc8a5beac236bcdc1ddc662e09d0cad6..61a02d3ad0e8ff1bfbe67a22b785a2a566d946dc 100644 (file)
@@ -1,5 +1,5 @@
 add_executable(rbd-fuse
   rbd-fuse.cc)
 target_link_libraries(rbd-fuse
-  librbd librados ${FUSE_LIBRARIES})
+  librbd librados common ${FUSE_LIBRARIES})
 install(TARGETS rbd-fuse DESTINATION bin)
index 560ec50e4eebd59c3cba2b835428c3cb194fd35b..ad2cf9488ce249a4d3ad8b24cbfd0080c31a35e5 100644 (file)
@@ -133,6 +133,7 @@ add_executable(ceph_test_librbd_fsx
 target_link_libraries(ceph_test_librbd_fsx
   librbd
   librados
+  journal
   global
   m
   ${CMAKE_DL_LIBS}
index 36c7303b45ff48bfaad446c6757cfe9aa6242506..42d3a5d0e5b323b0c996baca428d7947bda864a1 100644 (file)
@@ -42,7 +42,12 @@ add_executable(rbd ${rbd_srcs}
   $<TARGET_OBJECTS:common_texttable_obj>
   $<TARGET_OBJECTS:krbd_objs>)
 set_target_properties(rbd PROPERTIES OUTPUT_NAME rbd)
-target_link_libraries(rbd librbd librados global common keyutils udev
+target_link_libraries(rbd librbd librados
+  cls_journal_client cls_rbd_client
+  rbd_types
+  journal
+  common global
+  keyutils udev
   ${Boost_REGEX_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}
   ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
 install(TARGETS rbd DESTINATION bin)