Index: llvm/cmake/modules/HandleLLVMOptions.cmake =================================================================== --- llvm/cmake/modules/HandleLLVMOptions.cmake +++ llvm/cmake/modules/HandleLLVMOptions.cmake @@ -366,6 +366,21 @@ CMAKE_SHARED_LINKER_FLAGS) endif() + OPTION(LLVM_ENABLE_DEBUG_GHASH OFF) + if (LLVM_ENABLE_DEBUG_GHASH) + if (CLANG_CL AND LINKER_IS_LLD_LINK) + append("-mllvm -emit-codeview-ghash-section" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + append("/DEBUG:GHASH" CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS) + else() + if (NOT CLANG_CL) + message(WARNING "Option LLVM_ENABLE_DEBUG_GHASH is incompatible with cl.exe, clang-cl is required.") + endif() + if (NOT LINKER_IS_LLD_LINK) + message(WARNING "Option LLVM_ENABLE_DEBUG_GHASH is incompatible with link.exe, lld-link is required.") + endif() + endif() + endif() + # /Zc:strictStrings is incompatible with VS12's (Visual Studio 2013's) # debug mode headers. Instead of only enabling them in VS2013's debug mode, # we'll just enable them for Visual Studio 2015 (VS 14, MSVC_VERSION 1900)