[PATCH] D53012: [compiler-rt] [sanitizers] [windows] Use a linker directive pragma for psapi

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 9 11:49:21 PDT 2018


mstorsjo updated this revision to Diff 168844.
mstorsjo added a comment.

Assuming mingw library name logic elsewhere.


https://reviews.llvm.org/D53012

Files:
  lib/asan/CMakeLists.txt
  lib/sanitizer_common/sanitizer_win.cc


Index: lib/sanitizer_common/sanitizer_win.cc
===================================================================
--- lib/sanitizer_common/sanitizer_win.cc
+++ lib/sanitizer_common/sanitizer_win.cc
@@ -29,6 +29,10 @@
 #include "sanitizer_placement_new.h"
 #include "sanitizer_win_defs.h"
 
+#if defined(PSAPI_VERSION) && PSAPI_VERSION == 1
+#pragma comment(lib, "psapi")
+#endif
+
 // A macro to tell the compiler that this part of the code cannot be reached,
 // if the compiler supports this feature. Since we're using this in
 // code that is called when terminating the process, the expansion of the
Index: lib/asan/CMakeLists.txt
===================================================================
--- lib/asan/CMakeLists.txt
+++ lib/asan/CMakeLists.txt
@@ -100,7 +100,6 @@
 append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread ASAN_DYNAMIC_LIBS)
 append_list_if(COMPILER_RT_HAS_LIBLOG log ASAN_DYNAMIC_LIBS)
 append_list_if(MINGW "${MINGW_LIBRARIES}" ASAN_DYNAMIC_LIBS)
-append_list_if(MINGW psapi ASAN_DYNAMIC_LIBS)
 
 # Compile ASan sources into an object library.
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53012.168844.patch
Type: text/x-patch
Size: 1071 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181009/47c13caf/attachment.bin>


More information about the llvm-commits mailing list