[PATCH] D37636: [TableGen] Ensure that __lsan_is_turned_off isn't removed by DCE in llvm-tblgen

Francis Ricci via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 8 11:59:13 PDT 2017


fjricci created this revision.

Since asan is linked dynamically on Darwin, the weak interface symbol
is removed by -Wl,-dead_strip.


https://reviews.llvm.org/D37636

Files:
  utils/TableGen/TableGen.cpp


Index: utils/TableGen/TableGen.cpp
===================================================================
--- utils/TableGen/TableGen.cpp
+++ utils/TableGen/TableGen.cpp
@@ -217,6 +217,6 @@
 #include <sanitizer/lsan_interface.h>
 // Disable LeakSanitizer for this binary as it has too many leaks that are not
 // very interesting to fix. See compiler-rt/include/sanitizer/lsan_interface.h .
-int __lsan_is_turned_off() { return 1; }
+int __attribute__((__used__)) __lsan_is_turned_off() { return 1; }
 #endif  // __has_feature(address_sanitizer)
 #endif  // defined(__has_feature)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37636.114410.patch
Type: text/x-patch
Size: 578 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170908/e00b871e/attachment.bin>


More information about the llvm-commits mailing list