From: Jacek Caban jacek@codeweavers.com
This affects Clang in MSVC mode. By default, Clang treats __try/__except as regular exceptions, assuming that memory access doesn’t throw. As a result, it may incorrectly move code outside the exception handler or optimize away the handler entirely. MSVC always treats __try/__except as meaningful. Work around the issue by explicitly enabling -fasync-exceptions.
See https://github.com/llvm/llvm-project/issues/62606 more context. --- configure.ac | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configure.ac b/configure.ac index 2dcf3111f49..053c639ade1 100644 --- a/configure.ac +++ b/configure.ac @@ -540,6 +540,7 @@ This is an error since --enable-archs=$wine_arch was requested.])]) WINE_TRY_PE_CFLAGS([-fno-strict-aliasing]) dnl clang needs to be told to fail on unknown options WINE_TRY_PE_CFLAGS([-Werror=unknown-warning-option],[CFLAGS="$CFLAGS -Werror=unknown-warning-option"]) + WINE_TRY_PE_CFLAGS([-Werror=unused-command-line-argument],[CFLAGS="$CFLAGS -Werror=unused-command-line-argument"]) WINE_TRY_PE_CFLAGS([-Werror=ignored-optimization-argument],[CFLAGS="$CFLAGS -Werror=ignored-optimization-argument"]) WINE_TRY_PE_CFLAGS([-Wdeclaration-after-statement]) WINE_TRY_PE_CFLAGS([-Wempty-body]) @@ -558,6 +559,7 @@ This is an error since --enable-archs=$wine_arch was requested.])]) WINE_TRY_PE_CFLAGS([-Wabsolute-value]) WINE_TRY_PE_CFLAGS([-Wenum-enum-conversion],[:],WINE_TRY_PE_CFLAGS([-Wenum-conversion])) WINE_TRY_PE_CFLAGS([-ffunction-sections]) + WINE_TRY_PE_CFLAGS([-fasync-exceptions -DMIN_CLANG_VERSION=19], AS_VAR_APPEND([${wine_arch}_EXTRACFLAGS],[" -fasync-exceptions"]))
dnl clang had broken -fms-hotpatch support before version 18 (https://github.com/llvm/llvm-project/pull/77245) WINE_TRY_PE_CFLAGS([-fms-hotpatch -DMIN_CLANG_VERSION=18],