From 06fad3fe9deccdc8ee4721ff028753f53c7ab87f Mon Sep 17 00:00:00 2001 From: gongweibao Date: Fri, 25 Aug 2017 12:01:57 +0800 Subject: [PATCH] hidden capi symbols (#3636) hidden capi symbols --- paddle/capi/CMakeLists.txt | 3 +++ paddle/capi/export.map | 6 ++++++ paddle/capi/export.sym | 0 3 files changed, 9 insertions(+) create mode 100644 paddle/capi/export.map create mode 100644 paddle/capi/export.sym diff --git a/paddle/capi/CMakeLists.txt b/paddle/capi/CMakeLists.txt index 11022d17541..dde99ab3400 100644 --- a/paddle/capi/CMakeLists.txt +++ b/paddle/capi/CMakeLists.txt @@ -53,7 +53,10 @@ add_custom_target(paddle_capi_whole ALL set_target_properties(paddle_capi_whole PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/${capi_whole_library}) +set(LINK_FLAGS " -Wl,--retain-symbols-file ${CMAKE_CURRENT_SOURCE_DIR}/export.sym -Wl,--version-script ${CMAKE_CURRENT_SOURCE_DIR}/export.map") +# TODO: merge mkl into paddle_capi_shared add_library(paddle_capi_shared SHARED ${CAPI_SOURCES}) +set_target_properties(paddle_capi_shared PROPERTIES LINK_FLAGS "${LINK_FLAGS}") target_include_directories(paddle_capi_shared PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) link_paddle_exe(paddle_capi_shared) diff --git a/paddle/capi/export.map b/paddle/capi/export.map new file mode 100644 index 00000000000..8d673f675dd --- /dev/null +++ b/paddle/capi/export.map @@ -0,0 +1,6 @@ +{ + global: + paddle_*; + local: + *; +}; diff --git a/paddle/capi/export.sym b/paddle/capi/export.sym new file mode 100644 index 00000000000..e69de29bb2d -- GitLab