[libunwind] [libunwind][cmake] Compile _Unwind* routines with -fexceptions (PR #121819)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 8 11:24:06 PST 2025


Andarwinux wrote:

> > > I wonder if it would be less bug-prone in the long term to just build the whole library with `-fexceptions` instead of trying to apply `-fexceptions` to _just_ the right files at this point in time. Feels like a brittle optimization for not much gain?
> > 
> > 
> > This will break MinGW LTO libunwind.
> 
> Can you clarify how?

Maybe this is a hidden bug, but I haven't investigated it too deeply, @mstorsjo may know better.
If you build MinGW LTO libunwind without `-fno-exceptions` or with -`fexceptions`, libunwind references `__gcc_personality_seh0`, which results in undefined symbols. cmake normally adds `-fno-exceptionson`, but not on the first build, because the toolchain is incomplete which causes cmake to think that the compiler doesn't support `-fno-exceptions`, which is how I found out about the problem.

https://github.com/llvm/llvm-project/pull/121819


More information about the cfe-commits mailing list