Module: wine Branch: master Commit: 81859c9af70aa5ed6da3060488d1815a3607c291 URL: https://gitlab.winehq.org/wine/wine/-/commit/81859c9af70aa5ed6da3060488d1815...
Author: Rémi Bernon rbernon@codeweavers.com Date: Wed Jun 21 07:11:09 2023 +0200
configure: Build x86_64 PE code with mcmodel=small.
Saving a huge number of .refptr indirections for all extern symbols.
---
configure | 33 +++++++++++++++++++++++++++++++++ configure.ac | 3 ++- 2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/configure b/configure index f41b9cd687f..f73bc827150 100755 --- a/configure +++ b/configure @@ -11527,6 +11527,39 @@ printf "%s\n" "$ac_res" >&6; } if eval test "x$"$as_ac_var"" = x"yes" then : as_fn_append ${wine_arch}_EXTRACFLAGS " -mcx16" +fi } + { as_ac_var=`printf "%s\n" "ac_cv_${wine_arch}_cflags_-mcmodel=small" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mcmodel=small" >&5 +printf %s "checking whether $CC supports -mcmodel=small... " >&6; } +if eval test ${$as_ac_var+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_wine_try_cflags_saved=$CFLAGS +ac_wine_try_cflags_saved_exeext=$ac_exeext +CFLAGS="$CFLAGS -nostdlib -nodefaultlibs -mcmodel=small" +ac_exeext=".exe" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int __cdecl mainCRTStartup(void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_ac_var=yes" +else $as_nop + eval "$as_ac_var=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS=$ac_wine_try_cflags_saved +ac_exeext=$ac_wine_try_cflags_saved_exeext +fi +eval ac_res=$$as_ac_var + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test "x$"$as_ac_var"" = x"yes" +then : + as_fn_append ${wine_arch}_EXTRACFLAGS " -mcmodel=small" fi } ;; esac
diff --git a/configure.ac b/configure.ac index bed7b2dec28..606be62632e 100644 --- a/configure.ac +++ b/configure.ac @@ -960,7 +960,8 @@ do [AS_VAR_APPEND([${wine_arch}_LDFLAGS],[" -Wl,--disable-stdcall-fixup"])]) ;; x86_64) WINE_TRY_PE_CFLAGS([-Wformat-overflow]) WINE_TRY_PE_CFLAGS([-Wnonnull]) - WINE_TRY_PE_CFLAGS([-mcx16]) ;; + WINE_TRY_PE_CFLAGS([-mcx16]) + WINE_TRY_PE_CFLAGS([-mcmodel=small]) ;; esac
dnl Determine debug info format