This is an archive of the discontinued LLVM Phabricator instance.

Prevent adding lld to test dependency (TEST_DEPS) when lld project is not built
ClosedPublic

Authored by anhtuyen on Oct 31 2019, 2:10 PM.

Details

Summary

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.

Diff Detail

Event Timeline

anhtuyen created this revision.Oct 31 2019, 2:10 PM
eugenis accepted this revision.Oct 31 2019, 4:13 PM

LGTM, sorry I've missed this case

This revision is now accepted and ready to land.Oct 31 2019, 4:13 PM

Thank you very much Evgenii @eugenis for your prompt review and approval!

This revision was automatically updated to reflect the committed changes.