File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ def do_configure(args):
4444 sycl_enable_xpti_tracing = 'ON'
4545 xpti_enable_werror = 'OFF'
4646
47+ # lld is needed on Windows or for the HIP plugin on AMD
48+ if platform .system () == 'Windows' or (args .hip and args .hip_platform == 'AMD' ):
49+ llvm_enable_projects += ';lld'
50+
4751 # replace not append, so ARM ^ X86
4852 if args .arm :
4953 llvm_targets_to_build = 'ARM;AArch64'
@@ -65,8 +69,6 @@ def do_configure(args):
6569 llvm_targets_to_build += ';AMDGPU'
6670 libclc_targets_to_build += libclc_amd_target_names
6771
68- # The HIP plugin for AMD uses lld for linking
69- llvm_enable_projects += ';lld'
7072 elif args .hip_platform == 'NVIDIA' and not args .cuda :
7173 llvm_targets_to_build += ';NVPTX'
7274 libclc_targets_to_build += libclc_nvidia_target_names
Original file line number Diff line number Diff line change @@ -383,6 +383,12 @@ if(OpenCL_INSTALL_KHRONOS_ICD_LOADER AND TARGET OpenCL-ICD)
383383 list (APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS OpenCL-ICD)
384384endif ()
385385
386+ # Build and install lld as part of the sycl-toolchain if available
387+ if ("lld" IN_LIST LLVM_ENABLE_PROJECTS)
388+ add_dependencies (sycl-toolchain lld)
389+ list (APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS lld)
390+ endif ()
391+
386392if ("cuda" IN_LIST SYCL_ENABLE_PLUGINS)
387393 # Ensure that libclc is enabled.
388394 list (FIND LLVM_ENABLE_PROJECTS libclc LIBCLC_FOUND)
@@ -403,14 +409,13 @@ if("hip" IN_LIST SYCL_ENABLE_PLUGINS)
403409 "HIP support requires adding \" libclc\" to the CMake argument \" LLVM_ENABLE_PROJECTS\" " )
404410 endif ()
405411
412+ if (NOT TARGET lld AND "${SYCL_BUILD_PI_HIP_PLATFORM} " STREQUAL "AMD" )
413+ message (FATAL_ERROR
414+ "HIP support requires adding \" lld\" to the CMake argument \" LLVM_ENABLE_PROJECTS\" " )
415+ endif ()
416+
406417 add_dependencies (sycl-toolchain libspirv-builtins pi_hip)
407418 list (APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS libspirv-builtins pi_hip)
408-
409- # On AMD platform lld is also needed
410- if ("${SYCL_BUILD_PI_HIP_PLATFORM} " STREQUAL "AMD" )
411- add_dependencies (sycl-toolchain lld)
412- list (APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS lld)
413- endif ()
414419endif ()
415420
416421if ("esimd_emulator" IN_LIST SYCL_ENABLE_PLUGINS)
You can’t perform that action at this time.
0 commit comments