[compiler-rt] e7853a5 - [CMake] Fix lld detection after D69685

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 28 13:05:50 PST 2019


Author: Fangrui Song
Date: 2019-12-28T13:05:12-08:00
New Revision: e7853a5ce21c466ae6261ec73933672610427a07

URL: https://github.com/llvm/llvm-project/commit/e7853a5ce21c466ae6261ec73933672610427a07
DIFF: https://github.com/llvm/llvm-project/commit/e7853a5ce21c466ae6261ec73933672610427a07.diff

LOG: [CMake] Fix lld detection after D69685

D69685 actually broke lld detection for my build (probably due to CMake
processing order).

Before:

```
build projects/compiler-rt/lib/sanitizer_common/tests/Sanitizer-x86_64-Test-Nolibc: ... bin/clang || ...
```

After:

```
build projects/compiler-rt/lib/sanitizer_common/tests/Sanitizer-x86_64-Test-Nolibc: ... bin/clang bin/lld || ...
```

Differential Revision: https://reviews.llvm.org/D71950

Added: 
    

Modified: 
    compiler-rt/cmake/Modules/AddCompilerRT.cmake

Removed: 
    


################################################################################
diff  --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
index bcb16584ff72..35a48c6af29c 100644
--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -465,7 +465,7 @@ function(add_compiler_rt_test test_suite test_name arch)
     set(TEST_LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${TEST_LINK_FLAGS}")
     separate_arguments(TEST_LINK_FLAGS)
   endif()
-  if(NOT COMPILER_RT_STANDALONE_BUILD AND COMPILER_RT_HAS_LLD AND TARGET lld)
+  if(NOT COMPILER_RT_STANDALONE_BUILD AND COMPILER_RT_HAS_LLD AND "lld" IN_LIST LLVM_ENABLE_PROJECTS)
     # 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)


        


More information about the llvm-commits mailing list