<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 21, 2017 at 11:46 AM, George Karpenkov <span dir="ltr"><<a href="mailto:ekarpenkov@apple.com" target="_blank">ekarpenkov@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Kostya,<div><br></div><div>Additionally, on one of the windows buildbots libfuzzer compilation fails due to __builtin_bswapX not available.</div></div></blockquote><div>I guess we are not compiling libFuzzer with clang there. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Would it be a good idea to #ifdef around that and do a manual slower implementation otherwise?</div></div></blockquote><div>That's fine, but every time we do such things there is a risk to lose performance w/o noticing. </div><div>So, please double-check that the main use case actually keeps using the proper intrinsic</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>As for the thread_local replacement, I’ll look into that, seems easiest to only apply the replacement for older Apple machines.</div></div></blockquote><div><br></div><div>ok</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>I’m more surprised it worked in the first place, since IIRC C++11 standard does not allow redefining keywords. </div></div></blockquote><div><br></div><div>But you only need to ifdef for the compilers that don't treat thread_local is the keyword, right? </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class="HOEnZb"><font color="#888888"><div><br></div><div>George</div></font></span><div><div class="h5"><div><br><div><blockquote type="cite"><div>On Apr 21, 2017, at 11:22 AM, Kostya Serebryany <<a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a>> wrote:</div><br class="m_-3961272477837414362Apple-interchange-newline"><div><div dir="ltr">yes, see it. thanks! </div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 21, 2017 at 11:22 AM, Kuba Mracek <span dir="ltr"><<a href="mailto:mracek@apple.com" target="_blank">mracek@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div>We've reverted the patch that tries to build libFuzzer by default.</div><div><br></div><div>We'll look into that.</div><span class="m_-3961272477837414362HOEnZb"><font color="#888888"><div><br></div><div>Kuba</div></font></span><div><div class="m_-3961272477837414362h5"><br><div><blockquote type="cite"><div>On 21 Apr 2017, at 11:17, Kostya Serebryany via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="m_-3961272477837414362m_8529092780375290532Apple-interchange-newline"><div><div dir="ltr">Breaks on windows. <div><pre style="font-family:'courier new',courier,monotype,monospace;font-size:inherit"><span class="m_-3961272477837414362m_8529092780375290532gmail-stdout">In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\yvals.h:7:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xkeycheck.h(25<wbr>0,5):  error: The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.
   #error The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.
    ^</span></pre><pre><span class="m_-3961272477837414362m_8529092780375290532gmail-stdout"><font face="courier new, courier, monotype, monospace" size="3"><a href="http://lab.llvm.org:8011/builders/sanitizer-windows/builds/10026/steps/build%20LLVMFuzzer/logs/stdio" target="_blank">http://lab.llvm.org:8011/build<wbr>ers/sanitizer-windows/builds/<wbr>10026/steps/build%20LLVMFuzzer<wbr>/logs/stdio</a><br></font></span></pre><br>Why did the cmake check on windows decide to use the -D hack? <pre><span class="m_-3961272477837414362m_8529092780375290532gmail-stdout"><font face="courier new, courier, monotype, monospace" size="3"><br></font></span></pre><pre><span class="m_-3961272477837414362m_8529092780375290532gmail-stdout"><font face="courier new, courier, monotype, monospace" size="3"><br></font></span></pre></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 21, 2017 at 10:39 AM, Kuba Mracek via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: kuba.brecka<br>
Date: Fri Apr 21 12:39:50 2017<br>
New Revision: 301007<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=301007&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=301007&view=rev</a><br>
Log:<br>
[libFuzzer] Changing thread_local to __thread in libFuzzer<br>
<br>
Old Apple compilers do not support thread_local keyword. This patch adds -Dthread_local=__thread when the compiler doesn't support thread_local.<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D32312" rel="noreferrer" target="_blank">https://reviews.llvm.org/D3231<wbr>2</a><br>
<br>
<br>
Modified:<br>
    llvm/trunk/lib/Fuzzer/CMakeLis<wbr>ts.txt<br>
<br>
Modified: llvm/trunk/lib/Fuzzer/CMakeLis<wbr>ts.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/CMakeLists.txt?rev=301007&r1=301006&r2=301007&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/lib/Fuzzer/CM<wbr>akeLists.txt?rev=301007&r1=301<wbr>006&r2=301007&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/Fuzzer/CMakeLis<wbr>ts.txt (original)<br>
+++ llvm/trunk/lib/Fuzzer/CMakeLis<wbr>ts.txt Fri Apr 21 12:39:50 2017<br>
@@ -1,3 +1,16 @@<br>
+include(CheckCXXSourceCompile<wbr>s)<br>
+<br>
+CHECK_CXX_SOURCE_COMPILES("<br>
+    static thread_local int blah;<br>
+    int main() {<br>
+      return 0;<br>
+    }<br>
+    " HAS_THREAD_LOCAL)<br>
+<br>
+if( NOT HAS_THREAD_LOCAL )<br>
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dthread_local=__thread")<br>
+endif()<br>
+<br>
 set(LIBFUZZER_FLAGS_BASE "${CMAKE_CXX_FLAGS}")<br>
 # Disable the coverage and sanitizer instrumentation for the fuzzer itself.<br>
 set(CMAKE_CXX_FLAGS "${LIBFUZZER_FLAGS_BASE} -fno-sanitize-coverage=trace-p<wbr>c-guard,edge,trace-cmp,indirec<wbr>t-calls,8bit-counters -Werror")<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
______________________________<wbr>_________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br></div></blockquote></div><br></div></div></div></blockquote></div><br></div>
</div></blockquote></div><br></div></div></div></div></blockquote></div><br></div></div>