<div dir="ltr">you can use dlsym to make sure there is no C++</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 22, 2013 at 6:18 PM, Sergey Matveev <span dir="ltr"><<a href="mailto:earthdok@google.com" target="_blank">earthdok@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Building in C mode doesn't guarantee that we're not linking libstdc++</div><div><br></div><div>
E.g.:</div><div><br></div>clang -fsanitize=leak --driver-mode=g++ -x c source.c<div><div class="h5"><div><div class="gmail_extra">
<br><div class="gmail_quote">On Thu, Aug 22, 2013 at 5:55 PM, Kostya Serebryany <span dir="ltr"><<a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div dir="ltr">this is easy to solve: put #ifdef __cplusplus #error into the code</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 22, 2013 at 5:50 PM, Sergey Matveev <span dir="ltr"><<a href="mailto:earthdok@google.com" target="_blank">earthdok@google.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">That would require the clang_lsan substitution to expand to clang and not clang++. It's possible, but someone could unknowingly change the substitution back to clang++ in the config and turn the test into a no-op.</div>


<div><div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 22, 2013 at 5:46 PM, Alexey Samsonov <span dir="ltr"><<a href="mailto:samsonov@google.com" target="_blank">samsonov@google.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Can you add a C sanity check lit-test (that would verify that C program compiles and links fine with LSan and LSan + ASan)? See sanity_check_pure_c.c in ASan test suite.</div>



<div class="gmail_extra"><div><div><br><br>
<div class="gmail_quote">On Thu, Aug 22, 2013 at 5:23 PM, Sergey Matveev <span dir="ltr"><<a href="mailto:earthdok@google.com" target="_blank">earthdok@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">




Author: smatveev<br>
Date: Thu Aug 22 08:23:22 2013<br>
New Revision: 189010<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=189010&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=189010&view=rev</a><br>
Log:<br>
[lsan] Build standalone LSan with -fno-rtti.<br>
<br>
Fix issue where C code could not be built with -fsanitize=leak.<br>
<br>
Modified:<br>
    compiler-rt/trunk/lib/lsan/CMakeLists.txt<br>
    compiler-rt/trunk/lib/lsan/tests/CMakeLists.txt<br>
<br>
Modified: compiler-rt/trunk/lib/lsan/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/CMakeLists.txt?rev=189010&r1=189009&r2=189010&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/CMakeLists.txt?rev=189010&r1=189009&r2=189010&view=diff</a><br>





==============================================================================<br>
--- compiler-rt/trunk/lib/lsan/CMakeLists.txt (original)<br>
+++ compiler-rt/trunk/lib/lsan/CMakeLists.txt Thu Aug 22 08:23:22 2013<br>
@@ -1,7 +1,8 @@<br>
 include_directories(..)<br>
<br>
 set(LSAN_CFLAGS<br>
-  ${SANITIZER_COMMON_CFLAGS})<br>
+  ${SANITIZER_COMMON_CFLAGS}<br>
+  -fno-rtti)<br>
<br>
 set(LSAN_COMMON_SOURCES<br>
   lsan_common.cc<br>
<br>
Modified: compiler-rt/trunk/lib/lsan/tests/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/tests/CMakeLists.txt?rev=189010&r1=189009&r2=189010&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/tests/CMakeLists.txt?rev=189010&r1=189009&r2=189010&view=diff</a><br>





==============================================================================<br>
--- compiler-rt/trunk/lib/lsan/tests/CMakeLists.txt (original)<br>
+++ compiler-rt/trunk/lib/lsan/tests/CMakeLists.txt Thu Aug 22 08:23:22 2013<br>
@@ -9,7 +9,7 @@ set(LSAN_TESTS_SRC<br>
   lsan_dummy_unittest.cc)<br>
<br>
 set(LSAN_TESTS_CFLAGS<br>
-  ${LSAN_CFLAGS}<br>
+  ${SANITIZER_COMMON_CFLAGS}<br>
   ${COMPILER_RT_GTEST_INCLUDE_CFLAGS}<br>
   -I${COMPILER_RT_SOURCE_DIR}/lib<br>
   -I${LSAN_SRC_DIR})<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br><div>Alexey Samsonov, MSK</div>
</font></span></div>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div>