summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-08-02 01:02:46 +0000
committerReid Kleckner <rnk@google.com>2016-08-02 01:02:46 +0000
commit1734b97901e6a1cc909f79fca5fb1d597851f12e (patch)
tree8f0960681cf109872a12b4762c992bc883ad03c9
parent622adc524f3f183bd2068b721546ccce4d37d2dc (diff)
downloadbcm5719-llvm-1734b97901e6a1cc909f79fca5fb1d597851f12e.tar.gz
bcm5719-llvm-1734b97901e6a1cc909f79fca5fb1d597851f12e.zip
[winasan] Try to fix LNK4099 warnings seen by users
/Zi creates a separate PDB that we're supposed to pass along with our sanitizer libraries, but the object library compilation rules aren't set up to handle that. Rather than set that up, put the debug info in the object files the way every other platform does it with /Z7. llvm-svn: 277406
-rw-r--r--compiler-rt/CMakeLists.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index 488dcea8ae1..f08da5836c5 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -228,8 +228,14 @@ 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(COMPILER_RT_HAS_Zi_FLAG)
- list(APPEND SANITIZER_COMMON_CFLAGS /Zi)
+elseif(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.
+ list(APPEND SANITIZER_COMMON_CFLAGS /Z7)
+ 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")
endif()
# Turn off several warnings.
OpenPOWER on IntegriCloud