[PATCH] D118162: [tblgen] Disable lsan weak hook when building with msvc

pierre gousseau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 25 09:41:50 PST 2022


pgousseau created this revision.
pgousseau added reviewers: fjricci, kcc, aaron.ballman, mgorny, jakubjelinek.
pgousseau requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This change is to fix a link time error when building llvm with msvc.

MSVC's implementation does not support weak hook or lsan so this change disables lsan's weak hook definition.

Tested with visual studio 2019 v16.9.6


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118162

Files:
  llvm/utils/TableGen/TableGen.cpp


Index: llvm/utils/TableGen/TableGen.cpp
===================================================================
--- llvm/utils/TableGen/TableGen.cpp
+++ llvm/utils/TableGen/TableGen.cpp
@@ -289,7 +289,8 @@
 #define __has_feature(x) 0
 #endif
 
-#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) ||       \
+#if __has_feature(address_sanitizer) ||                                        \
+    (defined(__SANITIZE_ADDRESS__) && !defined(_WIN32)) ||                     \
     __has_feature(leak_sanitizer)
 
 #include <sanitizer/lsan_interface.h>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118162.402947.patch
Type: text/x-patch
Size: 562 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220125/4d86ab72/attachment.bin>


More information about the llvm-commits mailing list