[PATCH] D47669: [cmake] Support LLD for CLANG_ORDER_FILE

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 1 18:26:47 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL333810: [cmake] Support LLD for CLANG_ORDER_FILE (authored by smeenai, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D47669

Files:
  cfe/trunk/tools/driver/CMakeLists.txt


Index: cfe/trunk/tools/driver/CMakeLists.txt
===================================================================
--- cfe/trunk/tools/driver/CMakeLists.txt
+++ cfe/trunk/tools/driver/CMakeLists.txt
@@ -98,13 +98,16 @@
   set(TOOL_INFO_BUILD_VERSION)
 endif()
 
-if(CLANG_ORDER_FILE AND (LD64_EXECUTABLE OR GOLD_EXECUTABLE))
+if(CLANG_ORDER_FILE AND
+   (LD64_EXECUTABLE OR LLVM_LINKER_IS_GOLD OR LLVM_LINKER_IS_LLD))
   include(CheckLinkerFlag)
 
   if (LD64_EXECUTABLE)
     set(LINKER_ORDER_FILE_OPTION "-Wl,-order_file,${CLANG_ORDER_FILE}")
-  elseif (GOLD_EXECUTABLE)
+  elseif (LLVM_LINKER_IS_GOLD)
     set(LINKER_ORDER_FILE_OPTION "-Wl,--section-ordering-file,${CLANG_ORDER_FILE}")
+  elseif (LLVM_LINKER_IS_LLD)
+    set(LINKER_ORDER_FILE_OPTION "-Wl,--symbol-ordering-file,${CLANG_ORDER_FILE}")
   endif()
 
   # This is a test to ensure the actual order file works with the linker.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47669.149594.patch
Type: text/x-patch
Size: 891 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180602/c448419c/attachment.bin>


More information about the cfe-commits mailing list