From 03fe3ce56c15aa8d61d255f479db182b46d0f161 Mon Sep 17 00:00:00 2001 From: liuzhenhai93 Date: Sat, 6 May 2023 11:33:26 +0800 Subject: [PATCH] fix brpc double link (#53512) * polish * polish * polish * polish * polish * polish * polish * polish * polish * polish * polish --- CMakeLists.txt | 5 +++++ paddle/fluid/inference/CMakeLists.txt | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 34110edff30..0509e26a605 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,6 +92,11 @@ message(STATUS "C compiler: ${CMAKE_C_COMPILER}, version: " "${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}") message(STATUS "AR tools: ${CMAKE_AR}") +if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND CMAKE_CXX_COMPILER_VERSION + VERSION_GREATER 10.4) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=uninitialized") +endif() + # MUSL build turn off warnings if(WITH_MUSL) set(CMAKE_CXX_FLAGS diff --git a/paddle/fluid/inference/CMakeLists.txt b/paddle/fluid/inference/CMakeLists.txt index 59035ab8cd0..36d01c0f059 100644 --- a/paddle/fluid/inference/CMakeLists.txt +++ b/paddle/fluid/inference/CMakeLists.txt @@ -151,6 +151,14 @@ if(NOT APPLE AND NOT WIN32) # TODO(liuyiqun): Temporarily disable the link flag because it is not support on Mac. set(LINK_FLAGS "-Wl,--version-script ${CMAKE_CURRENT_SOURCE_DIR}/paddle_inference.map") + + # temporarily fix brpc double link issue(52842) + if(WITH_INFERENCE_API_TEST + AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 10.4) + set(LINK_FLAGS "${LINK_FLAGS} -Wl,-Bsymbolic") + endif() + set_target_properties(paddle_inference_shared PROPERTIES LINK_FLAGS "${LINK_FLAGS}") # check symbol hidden -- GitLab