Skip to content

Commit ea8bb4d

Browse files
authored
[offload] - Fix issue with standalone debug offload build (#104647)
Error: CommandLine Error: Option 'attributor-manifest-internal' registered more than once During the standalone debug build of offload the above error is seen at app runtime when using a prebuilt llvm with LLVM_LINK_LLVM_DYLIB=ON. This is caused by linking both libLLVM.so and various archives that are found via llvm_map_components_to_libnames for jit support.
1 parent 42ce628 commit ea8bb4d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

offload/plugins-nextgen/common/CMakeLists.txt

+9-7
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ add_dependencies(PluginCommon intrinsics_gen)
1111

1212
# Only enable JIT for those targets that LLVM can support.
1313
set(supported_jit_targets AMDGPU NVPTX)
14-
foreach(target IN LISTS supported_jit_targets)
15-
if("${target}" IN_LIST LLVM_TARGETS_TO_BUILD)
16-
target_compile_definitions(PluginCommon PRIVATE "LIBOMPTARGET_JIT_${target}")
17-
llvm_map_components_to_libnames(llvm_libs ${target})
18-
target_link_libraries(PluginCommon PRIVATE ${llvm_libs})
19-
endif()
20-
endforeach()
14+
if (NOT LLVM_LINK_LLVM_DYLIB)
15+
foreach(target IN LISTS supported_jit_targets)
16+
if("${target}" IN_LIST LLVM_TARGETS_TO_BUILD)
17+
target_compile_definitions(PluginCommon PRIVATE "LIBOMPTARGET_JIT_${target}")
18+
llvm_map_components_to_libnames(llvm_libs ${target})
19+
target_link_libraries(PluginCommon PRIVATE ${llvm_libs})
20+
endif()
21+
endforeach()
22+
endif()
2123

2224
# Include the RPC server from the `libc` project if availible.
2325
if(TARGET llvmlibc_rpc_server AND ${LIBOMPTARGET_GPU_LIBC_SUPPORT})

0 commit comments

Comments
 (0)