From: Jacek Caban jacek@codeweavers.com
On Clang, this flag serves as a replacement for the __ms_hook_prologue__ attribute. --- aclocal.m4 | 3 +++ configure.ac | 5 +++++ 2 files changed, 8 insertions(+)
diff --git a/aclocal.m4 b/aclocal.m4 index b319e283209..9efbd7ebb3e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -198,6 +198,9 @@ ac_wine_try_cflags_saved_exeext=$ac_exeext CFLAGS="$CFLAGS -nostdlib -nodefaultlibs $1" ac_exeext=".exe" AC_LINK_IFELSE([AC_LANG_SOURCE([[void *__os_arm64x_dispatch_ret = 0; +#if defined(__clang_major__) && defined(MIN_CLANG_VERSION) && __clang_major__ < MIN_CLANG_VERSION +#error Too old clang version +#endif int __cdecl mainCRTStartup(void) { return 0; }]])], [AS_VAR_SET(ac_var,yes)], [AS_VAR_SET(ac_var,no)]) CFLAGS=$ac_wine_try_cflags_saved diff --git a/configure.ac b/configure.ac index d82e338ae2b..94260d7ae7b 100644 --- a/configure.ac +++ b/configure.ac @@ -963,6 +963,11 @@ This is an error since --enable-archs=$wine_arch was requested.])]) WINE_TRY_PE_CFLAGS([-Wenum-enum-conversion],[:],WINE_TRY_PE_CFLAGS([-Wenum-conversion])) WINE_TRY_PE_CFLAGS([-ffunction-sections])
+ 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], + [AS_VAR_APPEND([${wine_arch}_EXTRACFLAGS],[" -fms-hotpatch"]) + AS_VAR_APPEND([${wine_arch}_LDFLAGS],[" -fms-hotpatch"])]) + dnl GCC can't handle large files when -Wmisleading-indentation is enabled (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89549) WINE_TRY_PE_CFLAGS([-flarge-source-files -Wmisleading-indentation],[AS_VAR_APPEND(${wine_arch}_EXTRACFLAGS,[" -Wno-misleading-indentation"])])