[clang] c624cc2 - [CMake][Clang] Skip host link version detection for lld on Darwin

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 21 18:33:05 PDT 2022


Author: Petr Hosek
Date: 2022-03-21T18:32:03-07:00
New Revision: c624cc252738c30ada3f00a498e971a7a3a84196

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

LOG: [CMake][Clang] Skip host link version detection for lld on Darwin

When lld is being used as host linker, skip version detection since
lld version cannot be used interchangeably with ld64 version and lld
is already handled specially in Clang driver.

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

Added: 
    

Modified: 
    clang/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 937a8467df1d7..78f584f18bacd 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -403,7 +403,7 @@ endif ()
 
 # Determine HOST_LINK_VERSION on Darwin.
 set(HOST_LINK_VERSION)
-if (APPLE)
+if (APPLE AND NOT CMAKE_LINKER MATCHES ".*lld.*")
   set(LD_V_OUTPUT)
   execute_process(
     COMMAND sh -c "${CMAKE_LINKER} -v 2>&1 | head -1"


        


More information about the cfe-commits mailing list