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?
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)
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?
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?
Exception handling relies on RTTI and controls different, but related,
machinery from -fno-rtti.
Is there a way to use gnu exception handling on windows generated bitcode?
> 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?
I made a scratchmake with enabled LLVM_ENABLE_EH and LLVM_ENABLE_RTTI, but the error is still the same.
(I also had to add /EHsc and /bigobj to CMAKE_CXX_FLAGS_DEBUG to make msvc happy)
With "-cc1", I can now also force clang to generate gnu exceptionhandling, but this introduces lots of _cxa dependencies, which would also be problem.
I played around with SJLJ EH. I know its not exactly zero cost, but it would still solve a lot of problems. Unfortunately, enabling it (-fsjlj-exceptions) hits an assert in codegen:
Assertion failed: handler.Type.Flags == 0 && "landingpads do not support catch handler flags", file C:\clang\src\tools\clang\lib\CodeGen\CGException.cpp, line 814
Would SJLJ require library support too?
Are there plans to get exceptionhandling on windows, without link.exe, to work?
There are no plans to support EH without either the MSVC or GNU standard
C++ library. If you can convince lli to resolve symbols against either one
of those, you should be in business.