llvm-mingw
llvm-mingw copied to clipboard
How to build a toolchain with SJLJ exceptions?
I'm trying to build a toolchain which uses SJLJ exceptions on i686 (instead of dwarf).
I tried reverting f9ce177 and recompiled everything. The resulting toolchain mostly works, except when I try to use LTO, the linker fails with undefined reference to _Unwind_Resume
.
It looks like the toolchain forgets about -fsjlj-exceptions
when LTO is requested. Is this a bug in Clang/LLVM? Or am I missing something?
I'm trying to build a toolchain which uses SJLJ exceptions on i686 (instead of dwarf).
I tried reverting f9ce177 and recompiled everything. The resulting toolchain mostly works, except when I try to use LTO, the linker fails with undefined reference to
_Unwind_Resume
.It looks like the toolchain forgets about
-fsjlj-exceptions
when LTO is requested. Is this a bug in Clang/LLVM? Or am I missing something?
I guess it can be considered a bug or just a missing feature... I don't do much LTO compilation, so I guess I never noticed this while using nonstandard exception handling mechanisms.
When compiling with LTO, the compilation pass just stores LLVM IR in the object files. Some code generation options, like -fsjlj-exceptions
, aren't persisted in the LLVM IR (where it would end up kept per translation unit - I don't think it'd support using different exception handling models for different object files in the same LTO compilation). So one would need to pass some code generation option like --exception-model=sjlj
to the linker to pass to the LTO code generation step. I'm not offhand familiar with how to pass such options though.