32-bit SEH support
Since LLVM is "more blessed" wrt Windows support, compared to GCC, is it possible to get 32-bit SEH working with mingw-w64? I'm assuming that the code generation part is already done, either by Microsoft or from other people, so can we leverage that?
Since LLVM is "more blessed" wrt Windows support, compared to GCC, is it possible to get 32-bit SEH working with mingw-w64? I'm assuming that the code generation part is already done, either by Microsoft or from other people, so can we leverage that?
Maybe - but it would probably still be a bit of work.
Note that the i386 unwind mechanism in MSVC/clang-cl is quite different from the SEH mechanism used on x86_64 and arm/arm64 - I'm not sure if the i386 mechanism even qualifies as "SEH" or what it would be called.
But anyway - yes, Clang/LLVM does support generating that kind of code.
But for it to work in a mingw environment, the unwind library also would need to support it. Right now, libunwind is mainly a library that deals with DWARF unwinding, but it also has got variants for other unwind formats like SEH, SJLJ and ARM EHABI - see the various Unwind-* files in https://github.com/llvm/llvm-project/tree/main/libunwind/src. I believe that the MSVC i386 mechanism structurally is kinda close to SJLJ.
It's also possible that the unwind info generation only is set up to work with the MSVC style C++ unwinding, not with Itanium C++ unwinding. (For SEH, the SEH unwind info layer was mostly decoupled from the actual language specific unwind handling, but I'm not sure how the separation works for this mechanism.)
For AArch64, it was trivial to switch mingw over from DWARF to SEH when both LLVM supported SEH for AArch64 and libunwind already supported SEH for x86_64. And for ARM it was also easy to switch mingw over to SEH once I had implemented SEH unwind generation for that backend. But for the i386 mechanism, I'm not entirely sure what it would involve.
So all in all - yes, it might be possible, but it's still not trivial, and most probably requires some work all over.