<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 8, 2016 at 2:52 AM, Stammerjohann, Kai 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><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
When I try to run this code via lli:<br>
<br>
#include <stdio.h><br>
<br>
int main()<br>
{<br>
try<br>
{<br>
throw "hi";<br>
}<br>
catch (const char *msg)<br>
{<br>
printf("%s\n", msg);<br>
}<br>
return 0;<br>
}<br>
<br>
It works as expected on linux but fails on windows:<br>
LLVM ERROR: Program used external function '??_7type_info@@6B@' which could not be resolved!<br>
<br>
This is what I execute:<br>
clang -fexceptions -c -emit-llvm a.cpp<br>
lli a.bc<br>
<br>
I guess "??_7type_info@@6B@" (aka "const type_info::`vftable'") comes from libcmt.lib and would require link.exe to resolve.<br>
type_info sounds like RTTI, but disabling (-fno-rtti) doesn't it fix the problem, I guess it's a requirement for exceptionhandling?<br></blockquote><div><br></div><div>Exception handling relies on RTTI and controls different, but related, machinery from -fno-rtti.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Is there a way to use gnu exception handling on windows generated bitcode?</blockquote><div><br></div><div>Yes, you could use a mingw triple.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> For my usecase, its perfectly fine to break compatibility to microsoft binaries (I tried to run clang with various targettriples, but didn't get it to work)<br>
<br>
_______________________________________________<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/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div></div>