https://reviews.llvm.org/D69405 added
check_linker_flag("-fuse-ld=lld" COMPILER_RT_HAS_FUSE_LD_LLD_FLAG)
into compiler-rt/cmake/config-ix.cmake.
And, if the compiler used to build llvm can support -fuse-ld=lld, then COMPILER_RT_HAS_LLD will be set on line 500 of compiler-rt/CMakeLists.txt.
set(COMPILER_RT_HAS_LLD ${COMPILER_RT_HAS_FUSE_LD_LLD_FLAG})
The changes above then adds lld into the TEST_DEPS dependency online 471 of compiler-rt/cmake/Modules/AddCompilerRT.cmake
if(NOT COMPILER_RT_STANDALONE_BUILD AND COMPILER_RT_HAS_LLD) # CMAKE_EXE_LINKER_FLAGS may contain -fuse=lld # FIXME: -DLLVM_ENABLE_LLD=ON and -DLLVM_ENABLE_PROJECTS without lld case. list(APPEND TEST_DEPS lld) endif()
This will cause failure if running LIT when the compiler was built without lld.
ninja: error: 'llvm/compiler-rt/lib/asan/tests/lld', needed by 'projects/compiler-rt/lib/asan/tests/dynamic/Asan-powerpc64le-calls-Dynamic-Test', missing and no known rule to make it
The patch is to fix the above-mentioned problem.