]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
cmake: exclude private symbols in public libs
authorKefu Chai <kchai@redhat.com>
Tue, 26 Jul 2016 06:53:07 +0000 (14:53 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 28 Jul 2016 11:15:04 +0000 (19:15 +0800)
commit0edfad088a0e3c2949c294bdb53332a89a75a25b
tree9cf68ddd602d475b6d069fc5c3dc20836935fd91
parent8382dda5f97334f9e693dcd00ff952729e8802f1
cmake: exclude private symbols in public libs

we should avoid exposing non-public symbols from user facing dynamic
libraries. so pass '--exclude-libs' with appropriate argument to linker.
as libcephfs does not add the ((visibility ("default"))) specifier to
the exported symbols, we can not set the default visiblity to hidden for
libcephfs, and "-export-symbols-regex" is a libtool option, we need to
develop a way for cmake to fix the visibility of libcephfs. it's still a
TODO.

* librados
  - pass '--exclude-libs=ALL' to linker
  - add buffer.cc to librados, so we can use '--exclude-libs=ALL'.
* libcephfs: pass '--exclude-libs=libcommon.a,libclient.a,libosdc.a' to
  linker
* libcommon
  - extract common_buffer_obj from libcommon, to avoid compilation
    this source file repeatly.
* tests:
  - link against common_internal_objs explicitly if the test in
    question is using the internal symbols.
* ceph-client-debug:
  - link against client explicitly, and do not link against librados
    anymore, as it is not used in this tool.

Fixes: http://tracker.ceph.com/issues/16556
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/CMakeLists.txt
src/librados/CMakeLists.txt
src/test/CMakeLists.txt
src/test/librados/CMakeLists.txt
src/tools/CMakeLists.txt