Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions buildbot/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ def do_configure(args):
sycl_enable_xpti_tracing = 'ON'
xpti_enable_werror = 'OFF'

# lld is needed on Windows or for the HIP plugin on AMD
if platform.system() == 'Windows' or (args.hip and args.hip_platform == 'AMD'):
llvm_enable_projects += ';lld'

# replace not append, so ARM ^ X86
if args.arm:
llvm_targets_to_build = 'ARM;AArch64'
Expand All @@ -65,8 +69,6 @@ def do_configure(args):
llvm_targets_to_build += ';AMDGPU'
libclc_targets_to_build += libclc_amd_target_names

# The HIP plugin for AMD uses lld for linking
llvm_enable_projects += ';lld'
elif args.hip_platform == 'NVIDIA' and not args.cuda:
llvm_targets_to_build += ';NVPTX'
libclc_targets_to_build += libclc_nvidia_target_names
Expand Down
17 changes: 11 additions & 6 deletions sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,12 @@ if(OpenCL_INSTALL_KHRONOS_ICD_LOADER AND TARGET OpenCL-ICD)
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS OpenCL-ICD)
endif()

# Build and install lld as part of the sycl-toolchain if available
if("lld" IN_LIST LLVM_ENABLE_PROJECTS)
add_dependencies(sycl-toolchain lld)
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS lld)
endif()

if("cuda" IN_LIST SYCL_ENABLE_PLUGINS)
# Ensure that libclc is enabled.
list(FIND LLVM_ENABLE_PROJECTS libclc LIBCLC_FOUND)
Expand All @@ -403,14 +409,13 @@ if("hip" IN_LIST SYCL_ENABLE_PLUGINS)
"HIP support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_PROJECTS\"")
endif()

if(NOT TARGET lld AND "${SYCL_BUILD_PI_HIP_PLATFORM}" STREQUAL "AMD")
message(FATAL_ERROR
"HIP support requires adding \"lld\" to the CMake argument \"LLVM_ENABLE_PROJECTS\"")
endif()

add_dependencies(sycl-toolchain libspirv-builtins pi_hip)
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS libspirv-builtins pi_hip)

# On AMD platform lld is also needed
if("${SYCL_BUILD_PI_HIP_PLATFORM}" STREQUAL "AMD")
add_dependencies(sycl-toolchain lld)
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS lld)
endif()
endif()

if("esimd_emulator" IN_LIST SYCL_ENABLE_PLUGINS)
Expand Down