llvm.org GIT mirror llvm / 614d096
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361214 91177308-0d34-0410-b5e6-96231b3b80d8 Nico Weber 2 months ago
1 changed file(s) with 2 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
1111 include(CheckCXXCompilerFlag)
1212 include(CheckSymbolExists)
1313
14 if(CMAKE_LINKER MATCHES "lld-link\\.exe" OR (WIN32 AND LLVM_USE_LINKER STREQUAL "lld") OR LLVM_ENABLE_LLD)
14 if(CMAKE_LINKER MATCHES "lld-link" OR (WIN32 AND LLVM_USE_LINKER STREQUAL "lld") OR LLVM_ENABLE_LLD)
1515 set(LINKER_IS_LLD_LINK TRUE)
1616 else()
1717 set(LINKER_IS_LLD_LINK FALSE)
684684 elseif (CLANG_CL)
685685 # Keep frame pointers around.
686686 append("/Oy-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
687 if (LINKER_IS_LLD_LINK)
688 # Use DWARF debug info with LLD.
689 append("-gdwarf" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
690 else()
691 # Enable codeview otherwise.
692 append("/Z7" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
693 endif()
694687 # Always ask the linker to produce symbols with asan.
688 append("/Z7" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
695689 append("-debug" CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
696690 endif()
697691 endmacro()