]> granicus.if.org Git - clang/commitdiff
[cmake] Add linker detection for Apple platforms
authorShoaib Meenai <smeenai@fb.com>
Thu, 14 Jun 2018 23:26:33 +0000 (23:26 +0000)
committerShoaib Meenai <smeenai@fb.com>
Thu, 14 Jun 2018 23:26:33 +0000 (23:26 +0000)
LLVM currently assumes that Apple platforms will always use ld64. In the
future, LLD Mach-O might also be supported, so add the beginnings of
linker detection support. ld64 is currently the only detected linker,
since `ld64.lld -v` doesn't yield any useful version output, but we can
add that detection later, and in the meantime it's still useful to have
the ld64 identification.

Switch clang's order file check to use this new detection rather than
just checking for the presence of an ld64 executable.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334780 91177308-0d34-0410-b5e6-96231b3b80d8

tools/driver/CMakeLists.txt

index 6e8748dd6284aee6b066cab74c14217ba252427a..db7055e886d8c0028f58c8015254ef5ef9f04557 100644 (file)
@@ -99,10 +99,10 @@ if (APPLE)
 endif()
 
 if(CLANG_ORDER_FILE AND
-   (LD64_EXECUTABLE OR LLVM_LINKER_IS_GOLD OR LLVM_LINKER_IS_LLD))
+    (LLVM_LINKER_IS_LD64 OR LLVM_LINKER_IS_GOLD OR LLVM_LINKER_IS_LLD))
   include(CheckLinkerFlag)
 
-  if (LD64_EXECUTABLE)
+  if (LLVM_LINKER_IS_LD64)
     set(LINKER_ORDER_FILE_OPTION "-Wl,-order_file,${CLANG_ORDER_FILE}")
   elseif (LLVM_LINKER_IS_GOLD)
     set(LINKER_ORDER_FILE_OPTION "-Wl,--section-ordering-file,${CLANG_ORDER_FILE}")