From d546de7bfa2e77fe209f0fb301b5bee7df44ea77 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Mon, 6 Apr 2020 07:24:28 -0700 Subject: [PATCH] Fix host linker options to have -Bsymbolic (#34534) (#34570) * Fix host linker options to have -Bsymbolic * Remove -Bsymbolic-functions Co-authored-by: Elinor Fung <47805090+elinor-fung@users.noreply.github.com> --- 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