<div dir="ltr">WAT!?<div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 29, 2015 at 5:50 PM, Alexey Samsonov <span dir="ltr"><<a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: samsonov<br>
Date: Wed Jul 29 19:50:40 2015<br>
New Revision: 243599<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D243599-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=nvkcPuS9Cz-wTEDRhczlAmHJbUIzlfK3-VLzbWk7WbY&s=diT8eRBQFDGrpDSjojaQZ4gjEO-URI1Lo2l7rmhsRCo&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=243599&view=rev</a><br>
Log:<br>
[Sanitizer] Replace diagnostic string literal to workaround CMake 2.8 bug.<br>
<br>
Let me tell you a story. Suppose you want to build your project (e.g. LLVM)<br>
with CMake 2.8, Clang and AddressSanitizer. You also want to ensure that<br>
Clang is fresh enough and check that CMAKE_CXX_COMPILER_VERSION is 3.1+.<br>
This check would fail - CMake would fail to correctly calculate compiler<br>
version if you pass CMAKE_CXX_FLAGS=-fsanitize=address.<br>
<br>
The problem is funky compiler version calculation in<br>
CMakeDetermineCompilerId.cmake module: it compiles the sample source<br>
file with provided compiler and compile flags, runs "strings" and greps<br>
for "INFO:" ASCII strings contained on the executable to fetch<br>
"INFO:compiler", "INFO:compiler_version" etc. It limits the output of<br>
grep to just 4 lines.<br>
<br>
Unfortunately, if your executable was built with ASan, it would also contain<br>
an ASCII string<br>
  INFO: %s ignores mlock/mlockall/munlock/munlockall<br>
and INFO:compiler_version string would never be parsed.<br>
<br>
All of the above actually happened after r243574 when we tried to<br>
configure libcxx with just-built Clang with TSan/MSan, and the version<br>
check mentioned above failed in HandleLLVMOptions.cmake<br>
<br>
(╯°□°)╯.~.┻━┻<br>
<br>
Modified:<br>
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc<br>
<br>
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_compiler-2Drt_trunk_lib_sanitizer-5Fcommon_sanitizer-5Fcommon-5Finterceptors.inc-3Frev-3D243599-26r1-3D243598-26r2-3D243599-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=nvkcPuS9Cz-wTEDRhczlAmHJbUIzlfK3-VLzbWk7WbY&s=ToMQEJzzZAkUUeEN39kUs-cVi-R9YnTGnx988Gv6nDY&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc?rev=243599&r1=243598&r2=243599&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc (original)<br>
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc Wed Jul 29 19:50:40 2015<br>
@@ -4957,7 +4957,7 @@ static void MlockIsUnsupported() {<br>
   static atomic_uint8_t printed;<br>
   if (atomic_exchange(&printed, 1, memory_order_relaxed))<br>
     return;<br>
-  VPrintf(1, "INFO: %s ignores mlock/mlockall/munlock/munlockall\n",<br>
+  VPrintf(1, "%s ignores mlock/mlockall/munlock/munlockall\n",<br>
           SanitizerToolName);<br>
 }<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>