<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Jul 21, 2015 at 6:30 PM Justin Bogner <<a href="mailto:mail@justinbogner.com">mail@justinbogner.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Paweł Bylica <<a href="mailto:chfast@gmail.com" target="_blank">chfast@gmail.com</a>> writes:<br>
> On Tue, Jul 21, 2015 at 5:55 PM Justin Bogner <<a href="mailto:mail@justinbogner.com" target="_blank">mail@justinbogner.com</a>> wrote:<br>
><br>
> Paweł Bylica <<a href="mailto:chfast@gmail.com" target="_blank">chfast@gmail.com</a>> writes:<br>
> > I can confirm that the issue has been caused by NDEBUG flag. <br>
> ><br>
> > On Mon, Jul 13, 2015 at 6:29 PM Reid Kleckner <<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>> wrote:<br>
> ><br>
> > The layout of AssertingVH has depended on NDEBUG since 2009, which<br>
> > predates any of our efforts to make LLVM's ABI resilient to<br>
> mismatched<br>
> > NDEBUG definitions between LLVM and its users.<br>
> ><br>
> > For now, make sure your definition of NDEBUG matches LLVM's. In the<br>
> long<br>
> > run, we could conceivably do something<br>
> > with LLVM_ENABLE_ABI_BREAKING_CHECKS to allow this mismatch.<br>
> ><br>
> > In practice it is very hard to make NDEBUG flag match configs of your<br>
> project<br>
> > and LLVM project. You often need to build debug and release versions of<br>
> your<br>
> > project and LLVM is installed as a debian package or with homebrew.<br>
> Moreover,<br>
> > there is not reliable way of checking if LLVM has been built with or<br>
> without<br>
> > NDEBUG.<br>
><br>
> FWIW, `llvm-config --assertion-mode` will tell you whether or not your<br>
> LLVM was built with or without NDEBUG.<br>
><br>
> That's not true in all cases. In case CMAKE_BUILD_TYPE=Release,<br>
> LLVM_ENABLE_ASSERTIONS=Off and CMAKE_CXX_FLAGS_RELEASE="" llvm-config reports<br>
> asserts as off but NDEBUG flag is not set.<br>
<br>
Um, okay, but why would you set CMAKE_CXX_FLAGS_RELEASE=""? That doesn't<br>
make any sense...<br></blockquote><div><br></div><div>I agree, it make no sense. But homebrew actually does that:</div><div><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Homebrew_homebrew_blob_master_Library_Homebrew_formula.rb-23L615&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=h296jL0xNRKmlemiWLH4DcFa9s53-_WjXEbCx-7iwFs&s=thA-llT26_Q7skjY-VGcZ_rT2pNvsXiNc3KCSL_nGW4&e=">https://github.com/Homebrew/homebrew/blob/master/Library/Homebrew/formula.rb#L615</a><br></div><div><br></div><div>There are many possible solutions for this case:</div><div>1. Force NDEBUG flag</div><div>2. Report a cmake error.</div><div>3. Get rid of LLVM_ENABLE_ASSERTIONS flag and relay on NDEBUG flag only.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
><br>
> > Can I do anything more about it? Contributions related to<br>
> > LLVM_ENABLE_ABI_BREAKING_CHECKS needed?<br>
> ><br>
> > - Paweł<br>
> ><br>
> > _______________________________________________<br>
> > LLVM Developers mailing list<br>
> > <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div></div>