Skip to content

Commit 4623c2f

Browse files
committed
Fix interaction of static plugins with -DLLVM_LINK_LLVM_DYLIB=ON.
We should link static plugins into libLLVM.so; they shouldn't depend on libLLVM.so. Fixes https://bugs.llvm.org/show_bug.cgi?id=45571 Differential Revision: https://reviews.llvm.org/D78332
1 parent 7d4546e commit 4623c2f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/cmake/modules/AddLLVM.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ function(add_llvm_pass_plugin name)
883883
list(REMOVE_ITEM ARG_UNPARSED_ARGUMENTS BUILDTREE_ONLY)
884884
# process_llvm_pass_plugins takes care of the actual linking, just create an
885885
# object library as of now
886-
add_llvm_library(${name} OBJECT ${ARG_UNPARSED_ARGUMENTS})
886+
add_llvm_component_library(${name} OBJECT ${ARG_UNPARSED_ARGUMENTS})
887887
target_compile_definitions(${name} PRIVATE LLVM_${name_upper}_LINK_INTO_TOOLS)
888888
set_property(TARGET ${name} APPEND PROPERTY COMPILE_DEFINITIONS LLVM_LINK_INTO_TOOLS)
889889
if (TARGET intrinsics_gen)

polly/lib/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ if (GPU_CODEGEN)
107107
llvm_map_components_to_libnames(nvptx_libs NVPTX)
108108
endif ()
109109

110-
if (LLVM_LINK_LLVM_DYLIB)
110+
if (LLVM_LINK_LLVM_DYLIB AND NOT LLVM_POLLY_LINK_INTO_TOOLS)
111111
# The shlib/dylib contains all the LLVM components
112112
# (including NVPTX is enabled) already. Adding them to target_link_libraries
113113
# would cause them being twice in the address space

0 commit comments

Comments
 (0)