[llvm] r361214 - Tweaks for setting CMAKE_LINKER to lld-link

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 20:01:01 PDT 2019


Author: nico
Date: Mon May 20 20:01:01 2019
New Revision: 361214

URL: http://llvm.org/viewvc/llvm-project?rev=361214&view=rev
Log:
Tweaks for setting CMAKE_LINKER to lld-link

- Just look for "lld-link", not "lld-link.exe".
  llvm/cmake/platforms/WinMsvc.cmake for example sets CMAKE_LINKER to
  lld-link without .exe

- Stop passing -gwarf to the compiler in sanitizer options when lld is
  enabled -- there's no reason to use different debug information keyed
  off the linker. (If this was for MinGW, we should check for that
  instead.)

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

Modified:
    llvm/trunk/cmake/modules/HandleLLVMOptions.cmake

Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=361214&r1=361213&r2=361214&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Mon May 20 20:01:01 2019
@@ -12,7 +12,7 @@ include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
 include(CheckSymbolExists)
 
-if(CMAKE_LINKER MATCHES "lld-link\\.exe" OR (WIN32 AND LLVM_USE_LINKER STREQUAL "lld") OR LLVM_ENABLE_LLD)
+if(CMAKE_LINKER MATCHES "lld-link" OR (WIN32 AND LLVM_USE_LINKER STREQUAL "lld") OR LLVM_ENABLE_LLD)
   set(LINKER_IS_LLD_LINK TRUE)
 else()
   set(LINKER_IS_LLD_LINK FALSE)
@@ -685,14 +685,8 @@ macro(append_common_sanitizer_flags)
   elseif (CLANG_CL)
     # Keep frame pointers around.
     append("/Oy-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
-    if (LINKER_IS_LLD_LINK)
-      # Use DWARF debug info with LLD.
-      append("-gdwarf" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
-    else()
-      # Enable codeview otherwise.
-      append("/Z7" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
-    endif()
     # Always ask the linker to produce symbols with asan.
+    append("/Z7" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
     append("-debug" CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
   endif()
 endmacro()




More information about the llvm-commits mailing list