Skip to content

Commit 1937dde

Browse files
authored
[SYCL][ROCm] Build lld when ROCm for AMD is enabled (#4402)
This patch ensures `lld` is built by default when the `pi_rocm` plugin for AMD is enabled as `lld` is required for linking with that setup.
1 parent 1d5b2cb commit 1937dde

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

buildbot/configure.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ def do_configure(args):
6161
if args.rocm_platform == 'AMD':
6262
llvm_targets_to_build += ';AMDGPU'
6363
libclc_targets_to_build += ';amdgcn--;amdgcn--amdhsa'
64+
65+
# The ROCm plugin for AMD uses lld for linking
66+
llvm_enable_projects += ';lld'
6467
elif args.rocm_platform == 'NVIDIA' and not args.cuda:
6568
llvm_targets_to_build += ';NVPTX'
6669
libclc_targets_to_build += ';nvptx64--;nvptx64--nvidiacl'

sycl/plugins/rocm/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ if("${SYCL_BUILD_PI_ROCM_PLATFORM}" STREQUAL "AMD")
4141

4242
# Set HIP define to select AMD platform
4343
target_compile_definitions(pi_rocm PRIVATE __HIP_PLATFORM_AMD__)
44+
45+
# Make sure lld is built as part of the toolchain
46+
add_dependencies(sycl-toolchain lld)
4447
elseif("${SYCL_BUILD_PI_ROCM_PLATFORM}" STREQUAL "NVIDIA")
4548
# Import CUDA libraries
4649
find_package(CUDA REQUIRED)

0 commit comments

Comments
 (0)