From 4922074edced12adefe94d9164f3ca07fc08e26f Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Mon, 9 Jul 2018 17:19:55 +0800 Subject: [PATCH] inference api symbol hidden --- paddle/contrib/inference/CMakeLists.txt | 2 +- paddle/contrib/inference/paddle_inference_api.map | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 paddle/contrib/inference/paddle_inference_api.map diff --git a/paddle/contrib/inference/CMakeLists.txt b/paddle/contrib/inference/CMakeLists.txt index c30eff50107..eda47aa4bfe 100644 --- a/paddle/contrib/inference/CMakeLists.txt +++ b/paddle/contrib/inference/CMakeLists.txt @@ -51,7 +51,7 @@ cc_library(paddle_inference_api_shared SHARED SRCS paddle_inference_api.cc paddle_inference_api_impl.cc) set_target_properties(paddle_inference_api_shared PROPERTIES OUTPUT_NAME paddle_inference_api) if(NOT APPLE) - set(LINK_FLAGS "-fPIC -fvisibility=hidden") + set(LINK_FLAGS "-Wl,--version-script ${CMAKE_CURRENT_SOURCE_DIR}/paddle_inference_api.map") set_target_properties(paddle_inference_api_shared PROPERTIES LINK_FLAGS "${LINK_FLAGS}") endif() diff --git a/paddle/contrib/inference/paddle_inference_api.map b/paddle/contrib/inference/paddle_inference_api.map new file mode 100644 index 00000000000..5203784dc1f --- /dev/null +++ b/paddle/contrib/inference/paddle_inference_api.map @@ -0,0 +1,6 @@ +{ + global: + *paddle*; + local: + *; +}; -- GitLab