From 7cb78d34a05931171a0e94665166242bdf4dfdfb Mon Sep 17 00:00:00 2001 From: Elinor Fung <47805090+elinor-fung@users.noreply.github.com> Date: Sun, 5 Apr 2020 01:34:03 -0700 Subject: [PATCH] Fix host linker options to have -Bsymbolic (#34534) * Fix host linker options to have -Bsymbolic * Remove -Bsymbolic-functions --- src/installer/corehost/cli/common.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/installer/corehost/cli/common.cmake b/src/installer/corehost/cli/common.cmake index 4cd09d3747b52..1bdf01527c186 100644 --- a/src/installer/corehost/cli/common.cmake +++ b/src/installer/corehost/cli/common.cmake @@ -32,6 +32,12 @@ if(CLR_CMAKE_TARGET_WIN32) list(APPEND SOURCES ${HEADERS}) endif() +# This is required to map a symbol reference to a matching definition local to the module (.so) +# containing the reference instead of using definitions from other modules. +if(CLR_CMAKE_TARGET_LINUX) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic") +endif() + function(set_common_libs TargetType) # Libraries used for exe projects