<div dir="ltr">On Mon, Jul 9, 2018 at 12:57 PM, Shoaib Meenai via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_8353301357373346373WordSection1">
<p class="MsoNormal"><span style="color:black">(adding back cfe-dev)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:black">You'll need to link against a blocks runtime library. compiler-rt provides one (under lib/BlocksRuntime). I haven't tried building that under Windows, but I do see some _WIN32 defines in the source code, so hopefully
it should work?</span></p></div></div></blockquote><div><br></div><div>The better maintained version is currently in swift-corelibs-foundation, under a directory called closure.</div><div><br></div><div><a href="https://github.com/apple/swift-corelibs-foundation/tree/master/closure">https://github.com/apple/swift-corelibs-foundation/tree/master/closure</a><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_8353301357373346373WordSection1"><p class="MsoNormal"><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border-style:solid none none;border-top-width:1pt;border-top-color:rgb(181,196,223);padding:3pt 0in 0in">
<p class="MsoNormal" style="margin-left:0.5in"><b><span style="font-size:12pt;color:black">From:
</span></b><span style="font-size:12pt;color:black">Thorben Hasenpusch <<a href="mailto:t.hasenpusch@icloud.com" target="_blank">t.hasenpusch@icloud.com</a>><br>
<b>Date: </b>Monday, July 9, 2018 at 12:40 PM<br>
<b>To: </b>Shoaib Meenai <<a href="mailto:smeenai@fb.com" target="_blank">smeenai@fb.com</a>><br>
<b>Subject: </b>Re: [cfe-dev] Clang-cl and C Blocks extension<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">But sadly, when trying to link I get this error: LNK2001: unresolved external symbol __imp__NSConcreteStackBlock.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">Do I have to link against something specific?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
</div>
<blockquote style="border-style:none none none solid;border-left-width:4.5pt;border-left-color:rgb(181,196,223);padding:0in 0in 0in 4pt;margin-left:3.75pt;margin-right:0in" id="gmail-m_8353301357373346373MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE">
<div>
<p class="MsoNormal" style="margin-left:0.5in">On 9. Jul 2018, at 21:32, Thorben Hasenpusch <<a href="mailto:t.hasenpusch@icloud.com" target="_blank">t.hasenpusch@icloud.com</a>> wrote:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">Thank you! That did the trick.<u></u><u></u></p>
</div><div><div class="gmail-h5">
<blockquote style="border-style:none none none solid;border-left-width:4.5pt;border-left-color:rgb(181,196,223);padding:0in 0in 0in 4pt;margin-left:3.75pt;margin-right:0in" id="gmail-m_8353301357373346373MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE">
<div>
<p class="MsoNormal" style="margin-left:0.5in">On 9. Jul 2018, at 21:11, Shoaib Meenai <<a href="mailto:smeenai@fb.com" target="_blank">smeenai@fb.com</a>> wrote:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">You can pass "-Xclang -fblocks" on the command line to pass the option to cc1 directly.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">From: cfe-dev <<a href="mailto:cfe-dev-bounces@lists.llvm.org" target="_blank">cfe-dev-bounces@lists.llvm.<wbr>org</a>> on behalf of cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">Reply-To: Thorben Hasenpusch <<a href="mailto:t.hasenpusch@icloud.com" target="_blank">t.hasenpusch@icloud.com</a>><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">Date: Monday, July 9, 2018 at 12:06 PM<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">To: cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">Subject: [cfe-dev] Clang-cl and C Blocks extension<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">Hi guys,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">I’m trying to compile C code that uses the Blocks extension using clang-cl on Windows, via CMake’s LLVM-vs2014 toolset.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">The compilation errors out, telling me I’d need to enable blocks by passing “-fblocks” to clang, however clang-cl doesn’t recognize that flag.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">Anything I can do?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">Thanks,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">Thorben<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">______________________________<wbr>_________________<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">cfe-dev mailing list<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_cfe-2Ddev&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=fXBg7mDMRpD5aFTwSkVGzQm_l-nEhQH52nOfnloTUfQ&s=eHXwWPv2JNzLoZeGlAh0qgOk3shPlYskr6yRzxNvjE0&e=" target="_blank">https://urldefense.proofpoint.<wbr>com/v2/url?u=http-3A__lists.<wbr>llvm.org_cgi-2Dbin_mailman_<wbr>listinfo_cfe-2Ddev&d=DwIGaQ&c=<wbr>5VD0RTtNlTh3ycd41b3MUw&r=<wbr>o3kDXzdBUE3ljQXKeTWOMw&m=<wbr>fXBg7mDMRpD5aFTwSkVGzQm_l-<wbr>nEhQH52nOfnloTUfQ&s=<wbr>eHXwWPv2JNzLoZeGlAh0qgOk3shPlY<wbr>skr6yRzxNvjE0&e=</a><u></u><u></u></p>
</div>
</blockquote>
</div></div></blockquote>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
</div>
</div>
</div>
<br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org</div>
</div></div>