On Tue, 13 Jan 2026, LIU Hao wrote:

在 2025-12-28 03:03, Pali Rohár 写道:
On Friday 26 December 2025 11:31:14 LIU Hao wrote:
在 2025-12-26 07:08, Pali Rohár 写道:
WinSDK header files also defines EXCEPTION_DISPOSITION as enum.
---
   mingw-w64-headers/crt/excpt.h | 13 ++++++-------
   1 file changed, 6 insertions(+), 7 deletions(-)


Somewhere in libunwind, an integer is returned (maybe it should be fixed in
libubwind), so this breaks libunwind somehow:

https://github.com/llvm/llvm-project/blob/7dcd69880102cda2fe1a43f3356abb0ec41f2dc4/libunwind/src/Unwind-seh.cpp#L166

And how it works when compiling with msvc? Because its SDK has already
defined it as enum.

Could it be fixed in libunwind?

I don't think it compiles with MSVC. The LLVM toolchain that is installed from Visual Studio Installer does not provide libunwind.dll.

Indeed, libunwind (and libcxxabi) are tied to the Itanium C++ ABI and aren't built when targeting MSVC; see [1].

I can confirm that if one do a number of tweaks to force this code to build in MSVC mode regardless, one does indeed hit the same errors there:

    /home/martin/code/llvm-project/libunwind/src/Unwind-seh.cpp(166,14): error:
          cannot initialize return object of type 'EXCEPTION_DISPOSITION' (aka 
'enum
          _EXCEPTION_DISPOSITION') with an rvalue of type 'int'
      166 |       return 4 /* ExceptionExecuteHandler in mingw */;
          |              ^

To move forward here, feel free to contribute a patch to libunwind to fixes the build here, without breaking the build with existing mingw-w64 headers inbetween.

// Martin


[1] 
https://github.com/llvm/llvm-project/commit/b0b546d44777eb1fa25995384876bd14a006a929
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to