From 70c9b48e3448cb92098897fbaa42cd12faf0da0c Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Thu, 17 Mar 2022 21:47:54 -0600 Subject: [PATCH] Ensure Clang/LLVM symbols are exposed for plugins --- lib/comgr/CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/comgr/CMakeLists.txt b/lib/comgr/CMakeLists.txt index 7611142..8313a58 100644 --- a/lib/comgr/CMakeLists.txt +++ b/lib/comgr/CMakeLists.txt @@ -143,8 +143,6 @@ if (UNIX) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/src/exportmap.in ${CMAKE_CURRENT_BINARY_DIR}/src/exportmap @ONLY) - list(APPEND AMD_COMGR_PRIVATE_LINKER_OPTIONS - "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/src/exportmap") # When building a shared library with -fsanitize=address we can't be # strict about undefined symbol references, as Clang won't include # libasan in the link, see @@ -295,7 +293,8 @@ else() llvm_map_components_to_libnames(LLVM_LIBS ${LLVM_TARGETS_TO_BUILD} DebugInfoDWARF - Symbolize) + Symbolize + ) endif() target_link_options(amd_comgr @@ -305,10 +304,13 @@ target_link_options(amd_comgr ${AMD_COMGR_PRIVATE_LINKER_OPTIONS}) target_link_libraries(amd_comgr - PRIVATE + PUBLIC + -Wl,--whole-archive ${LLD_LIBS} ${LLVM_LIBS} - ${CLANG_LIBS}) + ${CLANG_LIBS} + -Wl,--no-whole-archive + ) if (NOT UNIX) target_link_libraries(amd_comgr