From cdf55b77e0e198d039c527314189fd92dc80d796 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 28 May 2019 12:06:33 +0200 Subject: [PATCH] makefiles: Default to ms_abi for 64-bit msvcrt builds. Signed-off-by: Alexandre Julliard --- configure | 37 +++++++++++++++++++++++++++++++------ configure.ac | 14 ++++++++------ loader/Makefile.in | 2 +- 3 files changed, 40 insertions(+), 13 deletions(-) diff --git a/configure b/configure index 90c8e1af0c1..910bb57ba56 100755 --- a/configure +++ b/configure @@ -17197,8 +17197,8 @@ if test "x$ac_cv_cflags__fshort_wchar" = xyes; then : fi ;; esac - case $host_cpu in - *i[3456789]86*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-omit-frame-pointer" >&5 + case $host_cpu in + *i[3456789]86*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-omit-frame-pointer" >&5 $as_echo_n "checking whether the compiler supports -fno-omit-frame-pointer... " >&6; } if ${ac_cv_cflags__fno_omit_frame_pointer+:} false; then : $as_echo_n "(cached) " >&6 @@ -17223,10 +17223,9 @@ $as_echo "$ac_cv_cflags__fno_omit_frame_pointer" >&6; } if test "x$ac_cv_cflags__fno_omit_frame_pointer" = xyes; then : EXTRACFLAGS="$EXTRACFLAGS -fno-omit-frame-pointer" fi ;; - esac - - case $host in - x86_64-*mingw32*|x86_64-*cygwin*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wno-format" >&5 + *x86_64*) + case $host_os in + cygwin*|mingw32*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wno-format" >&5 $as_echo_n "checking whether the compiler supports -Wno-format... " >&6; } if ${ac_cv_cflags__Wno_format+:} false; then : $as_echo_n "(cached) " >&6 @@ -17251,6 +17250,32 @@ $as_echo "$ac_cv_cflags__Wno_format" >&6; } if test "x$ac_cv_cflags__Wno_format" = xyes; then : EXTRACFLAGS="$EXTRACFLAGS -Wno-format" fi ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -mabi=ms" >&5 +$as_echo_n "checking whether the compiler supports -mabi=ms... " >&6; } +if ${ac_cv_cflags__mabi_ms+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_wine_try_cflags_saved=$CFLAGS +CFLAGS="$CFLAGS -mabi=ms" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(int argc, char **argv) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_cflags__mabi_ms=yes +else + ac_cv_cflags__mabi_ms=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS=$ac_wine_try_cflags_saved +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__mabi_ms" >&5 +$as_echo "$ac_cv_cflags__mabi_ms" >&6; } +if test "x$ac_cv_cflags__mabi_ms" = xyes; then : + MSVCRTFLAGS="$MSVCRTFLAGS -mabi=ms" +fi ;; + esac ;; esac if test "x$enable_maintainer_mode" = "xyes" diff --git a/configure.ac b/configure.ac index ef7af7021a7..be15cca2e84 100644 --- a/configure.ac +++ b/configure.ac @@ -2022,14 +2022,16 @@ char*f(const char *h,char n) {return strchr(h,n);}]])],[ac_cv_c_logicalop_noisy= WINE_TRY_CFLAGS([-fshort-wchar],[MSVCRTFLAGS="$MSVCRTFLAGS -fshort-wchar"]) ;; esac - dnl gcc-4.6+ omits frame pointers by default, breaking some copy protections case $host_cpu in + dnl gcc-4.6+ omits frame pointers by default, breaking some copy protections *i[[3456789]]86*) WINE_TRY_CFLAGS([-fno-omit-frame-pointer]) ;; - esac - - dnl mingw uses Windows 64-bit types, not Unix ones - case $host in - x86_64-*mingw32*|x86_64-*cygwin*) WINE_TRY_CFLAGS([-Wno-format]) ;; + *x86_64*) + case $host_os in + dnl Mingw uses Windows 64-bit types, not Unix ones + cygwin*|mingw32*) WINE_TRY_CFLAGS([-Wno-format]) ;; + dnl Default to ms_abi on 64-bit + *) WINE_TRY_CFLAGS([-mabi=ms],[MSVCRTFLAGS="$MSVCRTFLAGS -mabi=ms"]) ;; + esac ;; esac dnl Enable -Werror for maintainer mode diff --git a/loader/Makefile.in b/loader/Makefile.in index a5e04ddcb8f..a776c8542b2 100644 --- a/loader/Makefile.in +++ b/loader/Makefile.in @@ -14,7 +14,7 @@ SOURCES = \ PROGRAMS = $(WINELOADER_PROGRAMS) INSTALL_LIB = $(WINELOADER_PROGRAMS) -preloader_EXTRADEFS = $(MSVCRTFLAGS) +preloader_EXTRADEFS = -fno-builtin wine_OBJS = main.o wine_DEPS = $(WINELOADER_DEPENDS)