[LLVMdev] LLVM_REQUIRES_EH

Dan Liew dan at su-root.co.uk
Mon Aug 18 04:11:10 PDT 2014


<snip>

> I can verify that this is a problem, and one that causes a crash.
>
> We use the REQUIRES_EH flag along with some CMakeLists changes to make sure that EH is turned on for all builds (but could switch to the other flag).    In most cases, mixed compiling shouldn't be a problem, but if something like a user-written ModulePass throws an exception, the program will break in interesting and magical ways since the stack isn't unwound correctly.   For us, not using exceptions is out of the question, so we need to turn them on for LLVM.
>
> That said, I don't have a particular preference on what flag is used, and it sounds like there is an alternative to REQUIRES_EH now, so I don't see a problem removing the old one (If I remember correctly it was messed up on Windows anyway).

The ENABLE_EH CMake option globally enables building without
``-fno-exceptions`` (``/EHs-c-`` for MSVC) so you should probably give
it a go.

Note the change in compiler flags produced using ENABLE_EH is exactly
what REQUIRES_EH does so if REQUIRES_EH is broken under Windows then
ENABLE_EH will also probably be broken as well :( . So if you have
problems with ENABLE_EH please submit a patch.

Thanks,
Dan Liew.




More information about the llvm-dev mailing list