Module: wine
Branch: master
Commit: 46aedd2ba4623f5ea72233d90c41c2291211b423
URL: http://source.winehq.org/git/wine.git/?a=commit;h=46aedd2ba4623f5ea72233d90…
Author: Alexandre Julliard <julliard(a)winehq.org>
Date: Fri Dec 8 13:22:31 2017 +0100
oleaut32: Disable floating point instructions for the soft-float ARM build.
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/oleaut32/typelib.c | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 388f108..4e72ac0 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -6443,7 +6443,10 @@ __ASM_GLOBAL_FUNC( call_method,
"subs r1, r1, #4\n\t" /* Decrement count */
"bgt 2b\n\t" /* Loop till done */
- "1:\tvldm r3!, {s0-s15}\n\t" /* Load the s0-s15/d0-d7 arguments */
+ "1:\n\t"
+#ifndef __SOFTFP__
+ "vldm r3!, {s0-s15}\n\t" /* Load the s0-s15/d0-d7 arguments */
+#endif
"mov ip, r0\n\t" /* Save the function call address to ip before we nuke r0 with arguments to pass */
"ldm r3, {r0-r3}\n\t" /* Load the r0-r3 arguments */
@@ -6854,14 +6857,18 @@ DispCallFunc(
UINT i;
DWORD *args;
struct {
+#ifndef __SOFTFP__
union {
float s[16];
double d[8];
} sd;
+#endif
DWORD r[4];
} regs;
int rcount; /* 32-bit register index count */
- int scount; /* single-precision float register index count (will be incremented twice for doubles, plus alignment) */
+#ifndef __SOFTFP__
+ int scount = 0; /* single-precision float register index count (will be incremented twice for doubles, plus alignment) */
+#endif
TRACE("(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d))\n",
pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg, pvargResult, V_VT(pvargResult));
@@ -6874,7 +6881,6 @@ DispCallFunc(
argspos = 0;
rcount = 0;
- scount = 0;
/* Determine if we need to pass a pointer for the return value as arg 0. If so, do that */
/* first as it will need to be in the 'r' registers: */
@@ -6912,14 +6918,9 @@ DispCallFunc(
{
case VT_EMPTY:
break;
- case VT_R4: /* these must be 4-byte aligned, and put in 's' regs or stack, as they are single-floats */
- if (scount < 16)
- regs.sd.s[scount++] = V_R4(arg);
- else
- args[argspos++] = V_UI4(arg);
- break;
case VT_R8: /* these must be 8-byte aligned, and put in 'd' regs or stack, as they are double-floats */
case VT_DATE:
+#ifndef __SOFTFP__
if (scount < 15)
{
scount += (scount % 2); /* align scount to next whole double */
@@ -6934,6 +6935,7 @@ DispCallFunc(
argspos += sizeof(V_R8(arg)) / sizeof(DWORD);
}
break;
+#endif
case VT_I8: /* these must be 8-byte aligned, and put in 'r' regs or stack, as they are long-longs */
case VT_UI8:
case VT_CY:
@@ -6977,6 +6979,14 @@ DispCallFunc(
else
args[argspos++] = V_BOOL(arg);
break;
+ case VT_R4: /* these must be 4-byte aligned, and put in 's' regs or stack, as they are single-floats */
+#ifndef __SOFTFP__
+ if (scount < 16)
+ regs.sd.s[scount++] = V_R4(arg);
+ else
+ args[argspos++] = V_UI4(arg);
+ break;
+#endif
default:
if (rcount < 4)
regs.r[rcount++] = V_UI4(arg);
@@ -6989,8 +6999,6 @@ DispCallFunc(
argspos += (argspos % 2); /* Make sure stack function alignment is 8-byte */
- TRACE("rcount: %d, scount: %d, argspos: %d\n", rcount, scount, argspos);
-
switch (vtReturn)
{
case VT_EMPTY: /* EMPTY = no return value */
Module: wine
Branch: master
Commit: 364e04ce0ca011c4bf8087d4982283093766ee56
URL: http://source.winehq.org/git/wine.git/?a=commit;h=364e04ce0ca011c4bf8087d49…
Author: Alexandre Julliard <julliard(a)winehq.org>
Date: Fri Dec 8 11:37:16 2017 +0100
configure: Add option for overriding the floating point ABI on ARM platforms.
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
configure | 38 +++++++++++++++++++++++++++++++-------
configure.ac | 31 ++++++++++++++++++++++++-------
2 files changed, 55 insertions(+), 14 deletions(-)
diff --git a/configure b/configure
index 5e1eeef..25930e3 100755
--- a/configure
+++ b/configure
@@ -829,6 +829,7 @@ with_coreaudio
with_cups
with_curses
with_dbus
+with_float_abi
with_fontconfig
with_freetype
with_gettext
@@ -2388,6 +2389,7 @@ Optional Packages:
--without-cups do not use CUPS
--without-curses do not use (n)curses
--without-dbus do not use DBus (dynamic device support)
+ --with-float-abi=abi specify the ABI (soft|softfp|hard) for ARM platforms
--without-fontconfig do not use fontconfig
--without-freetype do not use the FreeType library
--without-gettext do not use gettext
@@ -3545,6 +3547,12 @@ if test "${with_dbus+set}" = set; then :
fi
+# Check whether --with-float-abi was given.
+if test "${with_float_abi+set}" = set; then :
+ withval=$with_float_abi;
+fi
+
+
# Check whether --with-fontconfig was given.
if test "${with_fontconfig+set}" = set; then :
withval=$with_fontconfig;
@@ -5263,12 +5271,20 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- CFLAGS="$CFLAGS -marm"
- TARGETFLAGS="-marm"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports floating point" >&5
-$as_echo_n "checking whether $CC supports floating point... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ case $with_float_abi in
+ soft|softfp|hard)
+ float_abi=$with_float_abi ;;
+ *)
+ case $host_os in
+ *eabihf)
+ float_abi=hard ;;
+ *)
+ float_abi=softfp
+ saved_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS -marm -mfloat-abi=$float_abi"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mfloat-abi=$float_abi" >&5
+$as_echo_n "checking whether $CC supports -mfloat-abi=$float_abi... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -5285,10 +5301,18 @@ $as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- as_fn_error $? "You need a target with floating point support to build Wine for ARM." "$LINENO" 5
+ float_abi=soft
+ as_fn_append wine_warnings "|Floating point is not supported for this target. The resulting build won't be compatible with Windows ARM binaries."
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$saved_CFLAGS
+ esac
+ ;;
+ esac
+ CFLAGS="$CFLAGS -marm -mfloat-abi=$float_abi"
+ TARGETFLAGS="-marm -mfloat-abi=$float_abi"
+
;;
i[3456789]86*)
enable_win16=${enable_win16:-yes}
diff --git a/configure.ac b/configure.ac
index 8d9ec29..00413bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -43,6 +43,7 @@ AC_ARG_WITH(cups, AS_HELP_STRING([--without-cups],[do not use CUPS]))
AC_ARG_WITH(curses, AS_HELP_STRING([--without-curses],[do not use (n)curses]),
[if test "x$withval" = "xno"; then ac_cv_header_ncurses_h=no; ac_cv_header_curses_h=no; fi])
AC_ARG_WITH(dbus, AS_HELP_STRING([--without-dbus],[do not use DBus (dynamic device support)]))
+AC_ARG_WITH(float-abi, AS_HELP_STRING([--with-float-abi=abi],[specify the ABI (soft|softfp|hard) for ARM platforms]))
AC_ARG_WITH(fontconfig,AS_HELP_STRING([--without-fontconfig],[do not use fontconfig]))
AC_ARG_WITH(freetype, AS_HELP_STRING([--without-freetype],[do not use the FreeType library]))
AC_ARG_WITH(gettext, AS_HELP_STRING([--without-gettext],[do not use gettext]))
@@ -177,13 +178,29 @@ case $host in
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([You need a target with Thumb support to build Wine for ARM.])])
- CFLAGS="$CFLAGS -marm"
- AC_SUBST(TARGETFLAGS,"-marm")
- AC_MSG_CHECKING([whether $CC supports floating point])
- WINE_TRY_ASM_LINK(["vmrs r2,fpscr"],,,
- [AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])
- AC_MSG_ERROR([You need a target with floating point support to build Wine for ARM.])])
+ case $with_float_abi in
+ soft|softfp|hard)
+ float_abi=$with_float_abi ;;
+ *)
+ case $host_os in
+ *eabihf)
+ float_abi=hard ;;
+ *)
+ float_abi=softfp
+ saved_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS -marm -mfloat-abi=$float_abi"
+ AC_MSG_CHECKING([whether $CC supports -mfloat-abi=$float_abi])
+ WINE_TRY_ASM_LINK(["vmrs r2,fpscr"],,,
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ float_abi=soft
+ WINE_WARNING([Floating point is not supported for this target. The resulting build won't be compatible with Windows ARM binaries.])])
+ CFLAGS=$saved_CFLAGS
+ esac
+ ;;
+ esac
+ CFLAGS="$CFLAGS -marm -mfloat-abi=$float_abi"
+ AC_SUBST(TARGETFLAGS,"-marm -mfloat-abi=$float_abi")
;;
i[[3456789]]86*)
enable_win16=${enable_win16:-yes}