From 8e19bd45a9bbd7db58fe61cc327892f81fb71285 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 26 Apr 2018 20:34:19 +0000 Subject: [PATCH] Enable full debug info in the ASan runtime on Windows Clang-cl supports the -gline-tables-only flag, so we were going down that path. Honestly, we should just go ahead and enable full codeview support. llvm-svn: 330989 --- compiler-rt/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index dab56af..aaf6789 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -279,11 +279,7 @@ else() endif() # Build sanitizer runtimes with debug info. -if(COMPILER_RT_HAS_GLINE_TABLES_ONLY_FLAG AND NOT COMPILER_RT_DEBUG) - list(APPEND SANITIZER_COMMON_CFLAGS -gline-tables-only) -elseif(COMPILER_RT_HAS_G_FLAG) - list(APPEND SANITIZER_COMMON_CFLAGS -g) -elseif(MSVC) +if(MSVC) # Use /Z7 instead of /Zi for the asan runtime. This avoids the LNK4099 # warning from the MS linker complaining that it can't find the 'vc140.pdb' # file used by our object library compilations. @@ -291,6 +287,10 @@ elseif(MSVC) llvm_replace_compiler_option(CMAKE_CXX_FLAGS "/Z[i7I]" "/Z7") llvm_replace_compiler_option(CMAKE_CXX_FLAGS_DEBUG "/Z[i7I]" "/Z7") llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Z[i7I]" "/Z7") +elseif(COMPILER_RT_HAS_GLINE_TABLES_ONLY_FLAG AND NOT COMPILER_RT_DEBUG) + list(APPEND SANITIZER_COMMON_CFLAGS -gline-tables-only) +elseif(COMPILER_RT_HAS_G_FLAG) + list(APPEND SANITIZER_COMMON_CFLAGS -g) endif() if(LLVM_ENABLE_MODULES) -- 2.7.4