[cfe-dev] LLVM/Clang and setjmp/longjmp exception handling on MinGW

Ruben Van Boxem vanboxem.ruben at gmail.com
Sun Oct 9 05:57:22 PDT 2011


Hi,

In my neverending hobby quest to make all of LLVM better on Windows, I am
now stumbling over setjmp/longjmp and sjlj exception handling. To test I'm
linking with GCC 4.6's libstdc++ and libgcc. The problem also occurs with
libc++ and GCC's libsupc++.

I have attached the assembly output for a very simple exception testing
program:
#include <stdexcept>
#include <iostream>
using namespace std;

int main()
{
    try { throw runtime_error( "Hello world!" ); }
    catch( exception &e ) { cout << e.what(); }
}

GCC produces the sjlj initialization code, where Clang does not. Is sjlj
exception handling not used with Clang or is this a genuine bug?

Will fixing this hinder future efforts of using/porting stdcxxrt and
libunwind for MinGW, or will "flipping a hardcoded switch" be enough to make
that transition?

Thanks!

Ruben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111009/a0063b2c/attachment.html>


More information about the cfe-dev mailing list