[cfe-dev] LLVM ERROR: Program used external function '??_7type_info@@6B@' which could not be resolved!

Jonathan Roelofs via cfe-dev cfe-dev at lists.llvm.org
Wed Jun 8 07:02:27 PDT 2016



On 6/8/16 3:52 AM, Stammerjohann, Kai via cfe-dev wrote:
> Hi,
>
> When I try to run this code via lli:
>
> #include <stdio.h>
>
> int main()
> {
>      try
>      {
>          throw "hi";
>      }
>      catch (const char *msg)
>      {
>          printf("%s\n", msg);
>      }
>      return 0;
> }
>
> It works as expected on linux but fails on windows:
> LLVM ERROR: Program used external function '??_7type_info@@6B@' which could not be resolved!
>
> This is what I execute:
> 	clang -fexceptions -c -emit-llvm a.cpp
> 	lli a.bc
>
> I guess "??_7type_info@@6B@" (aka "const type_info::`vftable'") comes from libcmt.lib and would require link.exe to resolve.
> type_info sounds like RTTI, but disabling (-fno-rtti) doesn't it fix the problem, I guess it's a requirement for exceptionhandling?

Did you build llvm itself with rtti, and exceptions?

>
> Is there a way to use gnu exception handling on windows generated bitcode? 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)
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>

-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded



More information about the cfe-dev mailing list