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):
44
44
sycl_enable_xpti_tracing = 'ON'
45
45
xpti_enable_werror = 'OFF'
46
46
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
+
47
51
# replace not append, so ARM ^ X86
48
52
if args .arm :
49
53
llvm_targets_to_build = 'ARM;AArch64'
@@ -65,8 +69,6 @@ def do_configure(args):
65
69
llvm_targets_to_build += ';AMDGPU'
66
70
libclc_targets_to_build += libclc_amd_target_names
67
71
68
- # The HIP plugin for AMD uses lld for linking
69
- llvm_enable_projects += ';lld'
70
72
elif args .hip_platform == 'NVIDIA' and not args .cuda :
71
73
llvm_targets_to_build += ';NVPTX'
72
74
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)
383
383
list (APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS OpenCL-ICD )
384
384
endif ()
385
385
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
+
386
392
if ("cuda" IN_LIST SYCL_ENABLE_PLUGINS )
387
393
# Ensure that libclc is enabled.
388
394
list (FIND LLVM_ENABLE_PROJECTS libclc LIBCLC_FOUND )
@@ -403,14 +409,13 @@ if("hip" IN_LIST SYCL_ENABLE_PLUGINS)
403
409
"HIP support requires adding \" libclc\" to the CMake argument \" LLVM_ENABLE_PROJECTS\" " )
404
410
endif ()
405
411
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
+
406
417
add_dependencies (sycl-toolchain libspirv-builtins pi_hip )
407
418
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 ()
414
419
endif ()
415
420
416
421
if ("esimd_emulator" IN_LIST SYCL_ENABLE_PLUGINS )
You can’t perform that action at this time.
0 commit comments