From 6c614814da2c1a82ec07c97b874c4cb37f761109 Mon Sep 17 00:00:00 2001 From: Liu Yiqun Date: Wed, 14 Mar 2018 09:02:26 +0000 Subject: [PATCH] Limit the symbol table of fluid shared library. --- paddle/fluid/inference/CMakeLists.txt | 2 ++ paddle/fluid/inference/paddle_fluid.map | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 paddle/fluid/inference/paddle_fluid.map diff --git a/paddle/fluid/inference/CMakeLists.txt b/paddle/fluid/inference/CMakeLists.txt index 17ccca8cdc..f4609a3b5b 100644 --- a/paddle/fluid/inference/CMakeLists.txt +++ b/paddle/fluid/inference/CMakeLists.txt @@ -13,6 +13,8 @@ cc_library(paddle_fluid_shared SHARED SRCS io.cc DEPS ARCHIVE_START ${GLOB_OP_LIB} ${FLUID_CORE_MODULES} ARCHIVE_END) set_target_properties(paddle_fluid_shared PROPERTIES OUTPUT_NAME paddle_fluid) +set(LINK_FLAGS "-Wl,--version-script ${CMAKE_CURRENT_SOURCE_DIR}/paddle_fluid.map") +set_target_properties(paddle_fluid_shared PROPERTIES LINK_FLAGS "${LINK_FLAGS}") if(WITH_TESTING) add_subdirectory(tests/book) diff --git a/paddle/fluid/inference/paddle_fluid.map b/paddle/fluid/inference/paddle_fluid.map new file mode 100644 index 0000000000..5203784dc1 --- /dev/null +++ b/paddle/fluid/inference/paddle_fluid.map @@ -0,0 +1,6 @@ +{ + global: + *paddle*; + local: + *; +}; -- GitLab