[PATCH] Enable Asan on Windows

Alexey Samsonov vonosmas at gmail.com
Wed Sep 17 16:08:52 PDT 2014


================
Comment at: lib/asan/CMakeLists.txt:198
@@ +197,3 @@
+      if(MSVC)
+        set(OMIT_DEFAULT_LIB_NAME_FLAG "-Zl")
+      else()
----------------
Instead, add a check for this flag existence in cmake/config-ix.cmake, and append it if it's known:

  set(ASAN_THUNK_CFLAGS ${ASAN_CFLAGS} -DASAN_DYNAMIC_RUNTIME_THUNK)
  append_if(COMPILER_RT_HAS_Zl_FLAG "-Zl" ASAN_THUNK_CFLAGS)

or if it's always available in MSVC and should be added only there, use
  append_if(MSVC -Zl ASAN_THUNK_CFLAGS)

http://reviews.llvm.org/D5367






More information about the llvm-commits mailing list